Class: OrganizationPolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- OrganizationPolicy
- Defined in:
- app/policies/organization_policy.rb
Overview
Authorizes access to Organization objects
Instance Method Summary collapse
-
#create? ⇒ true
(also: #new?)
Anyone can create an organization.
-
#destroy? ⇒ false
We don't currently support destruction of organizations.
-
#index? ⇒ true
Everyone can view at least the subset of organizations to which they belong.
-
#show? ⇒ true
Anyone can view an organization.
- #update? ⇒ true, false (also: #edit?)
Methods inherited from ApplicationPolicy
Constructor Details
This class inherits a constructor from ApplicationPolicy
Instance Method Details
#create? ⇒ true Also known as: new?
Returns anyone can create an organization
14 15 16 |
# File 'app/policies/organization_policy.rb', line 14 def create? true end |
#destroy? ⇒ false
Returns we don't currently support destruction of organizations
29 30 31 |
# File 'app/policies/organization_policy.rb', line 29 def destroy? false end |
#index? ⇒ true
Returns everyone can view at least the subset of organizations to which they belong
4 5 6 |
# File 'app/policies/organization_policy.rb', line 4 def index? true end |
#show? ⇒ true
Returns anyone can view an organization
9 10 11 |
# File 'app/policies/organization_policy.rb', line 9 def show? true end |
#update? ⇒ true, false Also known as: edit?
22 23 24 |
# File 'app/policies/organization_policy.rb', line 22 def update? organization_user.owner? end |