Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. module Authorization
  2. module User
  3. # include ::DataMapper::Resource
  4. # This is a "vanity" relationship. A user may not have all permissions for an entire role,
  5. # but still may be said to be a member of the role.
  6. # has_and_belongs_to_many :roles
  7. has 1.0/0, :roles, :through => ::DataMapper::Resource
  8.  
  9. # This relationship contains the actual list of permissions the user has been granted.
  10. has 1.0/0, :permissions, :through => ::DataMapper::Resource
  11.  
  12. before :save, :assign_role
  13.  
  14. def revoke_role(role)
  15. #...
  16. end
Add Comment
Please, Sign In to add comment