Permalink
Browse files

task-assignment-permissions

The stories, tasks and task assignments associated with the project
need permissions similar to that of their containing project.  Let's
set their permission to check their containing project:

SHOW_PATCH
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 4d7525b commit 6bc889d741f968d15fee9430d5ae7e5d99b19945
Showing with 10 additions and 10 deletions.
  1. +3 −3 app/models/story.rb
  2. +3 −3 app/models/task.rb
  3. +4 −4 app/models/task_assignment.rb
View
@@ -19,15 +19,15 @@ class Story < ActiveRecord::Base
# --- Permissions --- #
def create_permitted?
acting_user.administrator?
project.creatable_by?(acting_user)
end
def update_permitted?
acting_user.signed_up? && !project_changed?
project.updatable_by?(acting_user)
end
def destroy_permitted?
acting_user.administrator?
project.destroyable_by?(acting_user)
end
def view_permitted?(field)
View
@@ -18,15 +18,15 @@ class Task < ActiveRecord::Base
# --- Permissions --- #
def create_permitted?
acting_user.administrator?
story.creatable_by?(acting_user)
end
def update_permitted?
acting_user.signed_up? && !story_changed?
story.updatable_by?(acting_user)
end
def destroy_permitted?
acting_user.administrator?
story.destroyable_by?(acting_user)
end
def view_permitted?(field)
@@ -13,19 +13,19 @@ class TaskAssignment < ActiveRecord::Base
# --- Permissions --- #
def create_permitted?
acting_user.administrator?
task.creatable_by?(acting_user)
end
def update_permitted?
acting_user.administrator?
task.updatable_by?(acting_user)
end
def destroy_permitted?
acting_user.administrator?
task.destroyable_by?(acting_user)
end
def view_permitted?(field)
true
task.viewable_by?(acting_user)
end
end

0 comments on commit 6bc889d

Please sign in to comment.