Class: ResourceLinkPolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- ResourceLinkPolicy
- Defined in:
- app/policies/resource_link_policy.rb
Overview
Protects access to ResourceLink objects
Instance Method Summary collapse
-
#create? ⇒ Boolean
(also: #new?)
Whether or not the user can create resource links for this organization.
-
#show? ⇒ true
Anyone can view a resource link belonging to their organization.
-
#update? ⇒ Boolean
(also: #edit?, #destroy?)
If the user can change an resource belonging to this organization.
Methods inherited from ApplicationPolicy
#index?, #initialize, #scope, #user
Constructor Details
This class inherits a constructor from ApplicationPolicy
Instance Method Details
#create? ⇒ Boolean Also known as: new?
Returns whether or not the user can create resource links for this organization
11 12 13 |
# File 'app/policies/resource_link_policy.rb', line 11 def create? organization_user. end |
#show? ⇒ true
Returns anyone can view a resource link belonging to their organization
6 7 8 |
# File 'app/policies/resource_link_policy.rb', line 6 def show? true end |
#update? ⇒ Boolean Also known as: edit?, destroy?
Returns if the user can change an resource belonging to this organization
18 19 20 |
# File 'app/policies/resource_link_policy.rb', line 18 def update? organization_user.editor? end |