Add a rule to check if users can admin boards on a project

parent 8afbd0ca
...@@ -58,6 +58,7 @@ class ProjectPolicy < BasePolicy ...@@ -58,6 +58,7 @@ class ProjectPolicy < BasePolicy
can! :update_issue can! :update_issue
can! :admin_issue can! :admin_issue
can! :admin_label can! :admin_label
can! :admin_board
can! :admin_list can! :admin_list
can! :read_commit_status can! :read_commit_status
can! :read_build can! :read_build
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{{ board.name }} {{ board.name }}
.dropdown-loading{ "v-if" => "loading" } .dropdown-loading{ "v-if" => "loading" }
= icon("spin spinner") = icon("spin spinner")
- if can?(current_user, :admin_list, @project) - if can?(current_user, :admin_board, @project)
%board-selector-form{ "inline-template" => true, %board-selector-form{ "inline-template" => true,
"v-if" => "currentPage === 'edit'", "v-if" => "currentPage === 'edit'",
"type" => "edit", "type" => "edit",
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
%button.btn.btn-default.pull-right{ type: "button", %button.btn.btn-default.pull-right{ type: "button",
"@click.stop.prevent" => "currentPage = ''" } "@click.stop.prevent" => "currentPage = ''" }
Cancel Cancel
- if can?(current_user, :admin_list, @project) - if can?(current_user, :admin_board, @project)
.dropdown-footer{ "v-if" => "currentPage === ''" } .dropdown-footer{ "v-if" => "currentPage === ''" }
%ul.dropdown-footer-list %ul.dropdown-footer-list
%li %li
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment