diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-03 21:09:18 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-03 21:09:18 +0200 |
commit | 39ba934c0a65f571214998e056e925b61f389360 (patch) | |
tree | a1da1af6df76e1d49feffd48a6247ced3abd5684 /app/models/ability.rb | |
parent | e6c0673ef1108a93928c4d88ba273e12616b836b (diff) | |
download | gitlab-ce-39ba934c0a65f571214998e056e925b61f389360.tar.gz |
REpostiry, Team models
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 75a7163c219..256af1e800b 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -15,17 +15,19 @@ class Ability def project_abilities(user, project) rules = [] + team = project.team + # Rules based on role in project - if project.master_access_for?(user) + if team.masters.include?(user) rules << project_master_rules - elsif project.dev_access_for?(user) + elsif team.developers.include?(user) rules << project_dev_rules - elsif project.report_access_for?(user) + elsif team.reporters.include?(user) rules << project_report_rules - elsif project.guest_access_for?(user) + elsif team.guests.include?(user) rules << project_guest_rules end |