[refs #90] clean ability

This commit is contained in:
Alexander Machehin 2012-10-02 22:46:51 +06:00
parent b3fd95d7fa
commit f699add7b4
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ class Ability
can :read, Issue, :project => {:owner_type => 'Group', :owner_id => user.group_ids} can :read, Issue, :project => {:owner_type => 'Group', :owner_id => user.group_ids}
can(:read, Issue, read_relations_for('issues', 'projects')) {|issue| can? :read, issue.project rescue nil} can(:read, Issue, read_relations_for('issues', 'projects')) {|issue| can? :read, issue.project rescue nil}
can(:create, Issue) {|issue| can? :read, issue.project} can(:create, Issue) {|issue| can? :read, issue.project}
can([:update, :destroy], Issue) {|issue| issue.user_id == user.id or local_admin?(issue.project)} can(:update, Issue) {|issue| issue.user_id == user.id or local_admin?(issue.project)}
cannot :manage, Issue, :project => {:has_issues => false} # switch off issues cannot :manage, Issue, :project => {:has_issues => false} # switch off issues
can :read, PullRequest, :base_project => {:owner_type => 'User', :owner_id => user.id} can :read, PullRequest, :base_project => {:owner_type => 'User', :owner_id => user.id}