summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-07-24 22:30:09 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-07-25 21:06:27 +0800
commite3aaa56c92f97f8aff3aeb847754794e9eae4706 (patch)
treeeb6c343901284f826ed808e500a53c7e804988dd /app/policies
parent3f14c56bfe77e83084b58dc2bd3c34e3c84c6cae (diff)
downloadgitlab-ce-e3aaa56c92f97f8aff3aeb847754794e9eae4706.tar.gz
Introduce PolicyCheckable for checking policiesce-7000-introduce-PolicyCheckable
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/concerns/policy_checkable.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/policies/concerns/policy_checkable.rb b/app/policies/concerns/policy_checkable.rb
new file mode 100644
index 00000000000..5aae23c18e9
--- /dev/null
+++ b/app/policies/concerns/policy_checkable.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+# Include this module if we want to pass something else than the user to
+# check policies. This defines several methods which the policy checker
+# would call and check.
+module PolicyCheckable
+ extend ActiveSupport::Concern
+
+ def blocked?
+ false
+ end
+
+ def admin?
+ false
+ end
+
+ def external?
+ false
+ end
+
+ def internal?
+ false
+ end
+
+ def access_locked?
+ false
+ end
+
+ def required_terms_not_accepted?
+ false
+ end
+
+ def can_create_group
+ false
+ end
+end