thecore_print_with_template 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70214d3834b9c0b2c0fd569896cccd6af431c9d0de7678ac79f3d79b879b4492
|
4
|
+
data.tar.gz: f56629d6030914cf6c20cffc7ee2051d8a6657bf7672305fa4e5dfd5f5e6e34f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dce871f3afd86e01df364b15eacf6df2c47beb3cd45474b642ab3b1262661a1eefafc602484de40df2dec8084bfa6c21ae53908fb03cee929f8cc027d2816b81
|
7
|
+
data.tar.gz: 3ab670108dd54c2d11cb1791634416c714708d2b2c5912ff5d9b9fe0d4c7706614baaaab930b48d94de9fff6dc6b54643c7b7e41e7479c5f8dcf7680cbfaf733
|
@@ -1,23 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# a specific role, brings specific powers
|
16
|
-
end
|
1
|
+
module Abilities
|
2
|
+
class ThecorePrintWithTemplatesCommon
|
3
|
+
include CanCan::Ability
|
4
|
+
def initialize user
|
5
|
+
if user
|
6
|
+
# if the user is logged in, it can do certain tasks regardless his role
|
7
|
+
if user.admin?
|
8
|
+
# if the user is an admin, it can do a lot of things, usually
|
9
|
+
end
|
10
|
+
|
11
|
+
if user.has_role? :role
|
12
|
+
# a specific role, brings specific powers
|
13
|
+
end
|
14
|
+
end
|
17
15
|
end
|
18
16
|
end
|
19
|
-
end
|
20
17
|
end
|
21
18
|
|
22
19
|
# include the extension
|
23
|
-
TheCoreAbilities.send(:include, ThecorePrintWithTemplateAbilitiesConcern)
|
20
|
+
# TheCoreAbilities.send(:include, ThecorePrintWithTemplateAbilitiesConcern)
|