#465: added #local_admin_manage? policy
This commit is contained in:
parent
92f7efed34
commit
5c7608ee4e
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue