Permalink
Browse files

view-permission-based-on-project-membership

Note that users now have two collections of projects: `projects` are the projects that users own, and `joined_projects` are the projects they have joined as members.

We can now define view permission on projects, stories and tasks according to project membership.

SHOW_PATCH
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent b390728 commit 7618e594ecbc154d017b64c65f91e451b959f3ec
Showing with 3 additions and 3 deletions.
  1. +1 −1 app/models/project.rb
  2. +1 −1 app/models/story.rb
  3. +1 −1 app/models/task.rb
View
@@ -34,7 +34,7 @@ def destroy_permitted?
end
def view_permitted?(field)
true
acting_user.administrator? || acting_user == owner || acting_user.in?(members)
end
end
View
@@ -31,7 +31,7 @@ def destroy_permitted?
end
def view_permitted?(field)
true
project.viewable_by?(acting_user)
end
end
View
@@ -30,7 +30,7 @@ def destroy_permitted?
end
def view_permitted?(field)
true
story.viewable_by?(acting_user)
end
end

0 comments on commit 7618e59

Please sign in to comment.