Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-10-23 11:36:35 +0300
committerShinya Maeda <shinya@gitlab.com>2017-10-23 11:36:35 +0300
commitd0cff7f5855f91b5479f9fdaa39d8d95ec691a9e (patch)
tree892e9ce3d95fdc19d3b258bac2a0cbb4705cf35f /app/policies/clusters
parente1d12ba9b988e61afb9317f3a132d6e2caa93923 (diff)
This works
Diffstat (limited to 'app/policies/clusters')
-rw-r--r--app/policies/clusters/cluster_policy.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/policies/clusters/cluster_policy.rb b/app/policies/clusters/cluster_policy.rb
new file mode 100644
index 00000000000..1f7c13072b9
--- /dev/null
+++ b/app/policies/clusters/cluster_policy.rb
@@ -0,0 +1,12 @@
+module Clusters
+ class ClusterPolicy < BasePolicy
+ alias_method :cluster, :subject
+
+ delegate { cluster.project }
+
+ rule { can?(:master_access) }.policy do
+ enable :update_cluster
+ enable :admin_cluster
+ end
+ end
+end