#465: added #local_admin_manage? policy
This commit is contained in:
parent
92f7efed34
commit
5c7608ee4e
|
@ -15,18 +15,19 @@ class PlatformPolicy < ApplicationPolicy
|
||||||
end
|
end
|
||||||
|
|
||||||
def update?
|
def update?
|
||||||
|
owner?
|
||||||
|
end
|
||||||
|
|
||||||
|
def local_admin_manage?
|
||||||
owner? || local_admin?
|
owner? || local_admin?
|
||||||
end
|
end
|
||||||
|
alias_method :add_project?, :local_admin_manage?
|
||||||
|
|
||||||
def clone?
|
def clone?
|
||||||
return false if record.personal?
|
return false if record.personal?
|
||||||
owner? || local_admin?
|
owner? || local_admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_project?
|
|
||||||
owner? || local_admin?
|
|
||||||
end
|
|
||||||
|
|
||||||
class Scope < Scope
|
class Scope < Scope
|
||||||
|
|
||||||
def related
|
def related
|
||||||
|
|
|
@ -36,10 +36,9 @@
|
||||||
- if policy(@platform).update?
|
- if policy(@platform).update?
|
||||||
li class=('active' if act == :edit && contr == :platforms)
|
li class=('active' if act == :edit && contr == :platforms)
|
||||||
= link_to t("platform_menu.settings"), edit_platform_path(@platform)
|
= 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)
|
li class=('active' if act == :members && contr == :platforms)
|
||||||
= link_to t("layout.platforms.members"), members_platform_path(@platform)
|
= link_to t("layout.platforms.members"), members_platform_path(@platform)
|
||||||
- if policy(@platform).update?
|
|
||||||
li class=('active' if contr == :key_pairs)
|
li class=('active' if contr == :key_pairs)
|
||||||
= link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform)
|
= link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform)
|
||||||
li class=('active' if contr == :tokens)
|
li class=('active' if contr == :tokens)
|
||||||
|
|
Loading…
Reference in New Issue