#465: added #local_admin_manage? policy

This commit is contained in:
Vokhmin Alexey V 2015-03-18 01:38:59 +03:00
parent 92f7efed34
commit 5c7608ee4e
2 changed files with 6 additions and 6 deletions

View File

@ -15,18 +15,19 @@ class PlatformPolicy < ApplicationPolicy
end
def update?
owner?
end
def local_admin_manage?
owner? || local_admin?
end
alias_method :add_project?, :local_admin_manage?
def clone?
return false if record.personal?
owner? || local_admin?
end
def add_project?
owner? || local_admin?
end
class Scope < Scope
def related

View File

@ -36,10 +36,9 @@
- if policy(@platform).update?
li class=('active' if act == :edit && contr == :platforms)
= link_to t("platform_menu.settings"), edit_platform_path(@platform)
- if policy(@platform).members?
- if policy(@platform).local_admin_manage?
li class=('active' if act == :members && contr == :platforms)
= link_to t("layout.platforms.members"), members_platform_path(@platform)
- if policy(@platform).update?
li class=('active' if contr == :key_pairs)
= link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform)
li class=('active' if contr == :tokens)