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
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-13 16:44:43 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-13 16:44:43 +0300
commit00970606d78486a8b6672659e9ea28521a102e44 (patch)
tree2b41f3344f9d894a75f87bda627eda911199722f /lib
parent24dd70d37834e55a7ead23ae14125e5e12f64d8b (diff)
Extract abilities checking module from ability model
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/allowable.rb8
-rw-r--r--lib/gitlab/ci/status/core.rb2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/allowable.rb b/lib/gitlab/allowable.rb
new file mode 100644
index 00000000000..3cc218f9db4
--- /dev/null
+++ b/lib/gitlab/allowable.rb
@@ -0,0 +1,8 @@
+module Gitlab
+ module Allowable
+ def can?(user, action, subject)
+ Ability.allowed?(user, action, subject)
+ end
+ end
+end
+
diff --git a/lib/gitlab/ci/status/core.rb b/lib/gitlab/ci/status/core.rb
index dd3a824e486..12c0ca1d6d5 100644
--- a/lib/gitlab/ci/status/core.rb
+++ b/lib/gitlab/ci/status/core.rb
@@ -5,7 +5,7 @@ module Gitlab
#
class Core
include Gitlab::Routing.url_helpers
- include Ability::Allowable
+ include Gitlab::Allowable
attr_reader :subject, :user