Skip to content

Commit

Permalink
project-memberships-permissions
Browse files Browse the repository at this point in the history
Then permissions -- only the project owner (and admins) can manipulate these project memberships:
  • Loading branch information
bryanlarsen authored and iox committed Aug 12, 2013
1 parent 0d3b8ff commit 73ec433
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/project_membership.rb
Expand Up @@ -13,15 +13,15 @@ class ProjectMembership < ActiveRecord::Base
# --- Permissions --- # # --- Permissions --- #


def create_permitted? def create_permitted?
acting_user.administrator? acting_user.administrator? || project.owner_is?(acting_user)
end end


def update_permitted? def update_permitted?
acting_user.administrator? acting_user.administrator? || project.owner_is?(acting_user)
end end


def destroy_permitted? def destroy_permitted?
acting_user.administrator? acting_user.administrator? || project.owner_is?(acting_user)
end end


def view_permitted?(field) def view_permitted?(field)
Expand Down

0 comments on commit 73ec433

Please sign in to comment.