Module: ProtectedRefAccess
Instance Attribute Summary
Attributes included from Importable
#importing, #user_contributions
Instance Method Summary
collapse
Instance Method Details
#check_access(current_user, current_project = protected_ref_project) ⇒ Object
71
72
73
74
75
76
77
78
79
80
|
# File 'app/models/concerns/protected_ref_access.rb', line 71
def check_access(current_user, current_project = protected_ref_project)
return false if current_user.nil? || no_access?
return current_user.admin? if admin_access?
send(:"#{type}_access_allowed?", current_user, current_project) end
|
#humanize ⇒ Object
63
64
65
66
67
68
69
|
# File 'app/models/concerns/protected_ref_access.rb', line 63
def humanize
send(:"humanize_#{type}") end
|
#role? ⇒ Boolean
59
60
61
|
# File 'app/models/concerns/protected_ref_access.rb', line 59
def role?
type == :role
end
|
#type ⇒ Object
55
56
57
|
# File 'app/models/concerns/protected_ref_access.rb', line 55
def type
:role
end
|