Class: Gritano::Core::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gritano::Core::User
- Defined in:
- lib/gritano-core/user.rb
Instance Method Summary collapse
- #add_access(repo, access_type) ⇒ Object
- #check_access(repo, access_type) ⇒ Object
- #remove_access(repo, access_type) ⇒ Object
Instance Method Details
#add_access(repo, access_type) ⇒ Object
11 12 13 14 15 |
# File 'lib/gritano-core/user.rb', line 11 def add_access(repo, access_type) = repo..where(user_id: self.id).first || repo..new(user_id: self.id) .add_access(access_type) .save end |
#check_access(repo, access_type) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/gritano-core/user.rb', line 23 def check_access(repo, access_type) = repo..where(user_id: self.id).first if .is(access_type) else false end end |
#remove_access(repo, access_type) ⇒ Object
17 18 19 20 21 |
# File 'lib/gritano-core/user.rb', line 17 def remove_access(repo, access_type) = repo..where(user_id: self.id).first || repo..new(user_id: self.id) .remove_access(access_type) .save end |