Module: ProtectedRefAccess
- Extended by:
- ActiveSupport::Concern
- Included in:
- ProtectedBranchAccess, ProtectedTagAccess
- Defined in:
- app/models/concerns/protected_ref_access.rb
Instance Method Summary collapse
Instance Method Details
#check_access(current_user) ⇒ Object
70 71 72 73 74 75 76 77 |
# File 'app/models/concerns/protected_ref_access.rb', line 70 def check_access(current_user) return false if current_user.nil? || no_access? return current_user.admin? if admin_access? yield if block_given? user_can_access?(current_user) end |
#humanize ⇒ Object
58 59 60 |
# File 'app/models/concerns/protected_ref_access.rb', line 58 def humanize self.class.humanize(access_level) end |
#role? ⇒ Boolean
66 67 68 |
# File 'app/models/concerns/protected_ref_access.rb', line 66 def role? type == :role end |
#type ⇒ Object
62 63 64 |
# File 'app/models/concerns/protected_ref_access.rb', line 62 def type :role end |