rubycs-declarative_authorization 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -3,7 +3,101 @@
|
|
3
3
|
This is a fork of Steffen Bartsch's declarative_authorization[http://github.com/stffn/declarative_authorization/tree] equipped with localization
|
4
4
|
based on Rails default I18n.
|
5
5
|
|
6
|
+
= Requirements
|
7
|
+
|
8
|
+
* Rails 2.2 or above
|
9
|
+
|
10
|
+
|
11
|
+
= Installation
|
12
|
+
|
13
|
+
One of three options to install the plugin:
|
14
|
+
|
15
|
+
* Install by Gem: Add to your environment.rb in the initializer block:
|
16
|
+
|
17
|
+
config.gem "rubycs-declarative_authorization", :lib => "declarative_authorization"
|
18
|
+
|
19
|
+
And call from your application’s root directory
|
20
|
+
|
21
|
+
rake gems:install
|
22
|
+
|
23
|
+
* Alternatively, to install from github, execute in your application’s root directory
|
24
|
+
|
25
|
+
cd vendor/plugins && git clone git://github.com/rubycs/declarative_authorization.git
|
26
|
+
|
27
|
+
* Or, download one of the released versions from Github at github.com/rubycs/declarative_authorization/downloads
|
28
|
+
|
6
29
|
|
7
30
|
= Usage
|
8
31
|
|
32
|
+
* Please check the original documentation[http://github.com/stffn/declarative_authorization/tree] for detailed instructions.
|
33
|
+
|
34
|
+
* Or, simply
|
35
|
+
|
36
|
+
** create a basic localization file. The original English file config/locales/en.declarative_authorization.yml looks like:
|
37
|
+
|
38
|
+
en:
|
39
|
+
declarative_authorization:
|
40
|
+
|
41
|
+
# app/controllers/authorization_rules_controller.rb
|
42
|
+
error_in_call_to_graphviz: Error in call to graphviz
|
43
|
+
|
44
|
+
# app/helpers/authorization_rules_helper.rb
|
45
|
+
rules: Rules
|
46
|
+
graphical_view: Graphical view
|
47
|
+
usages: Usages
|
48
|
+
no_filter_access_to_call_protects_this_action: No filter_access_to call protects this action
|
49
|
+
action_is_not_protected_with_attribute_check: Action is not protected with attribute check
|
50
|
+
privilege_set_automatically_from_action_name_by_all_rule: Privilege set automatically from action name by :all rule
|
51
|
+
context_set_automatically_from_controller_name_by_filter_access_to_call_without_context_option: Context set automatically from controller name by filter_access_to call without :context option
|
52
|
+
|
53
|
+
# app/views/authorization_rules/graph.html.erb
|
54
|
+
authorization_rules_graph: Authorization Rules Graph
|
55
|
+
privilege_hierarchy: Privilege hierarchy
|
56
|
+
currently_active_rules_in_this_application: Currently active rules in this application.
|
57
|
+
all_rules: All rules
|
58
|
+
all_contexts: All contexts
|
59
|
+
effective_privileges: Effective privileges
|
60
|
+
show_full_privilege_hierarchy: Show full privilege hierarchy
|
61
|
+
zoom_in: Zoom in
|
62
|
+
zoom_out: Zoom out
|
63
|
+
|
64
|
+
# app/views/authorization_rules/index.html.erb
|
65
|
+
authorization_rules: Authorization Rules
|
66
|
+
|
67
|
+
# app/views/authorization_usages/index.html.erb
|
68
|
+
authorization_usage: Authorization Usage
|
69
|
+
filter_rules_in_actions_by_controller: Filter rules in actions by controller
|
70
|
+
|
71
|
+
# lib/declarative_authorization/in_controller.rb
|
72
|
+
you_are_not_allowed_to_access_this_action: You are not allowed to access this action
|
73
|
+
|
74
|
+
|
75
|
+
** create a config/authorization_rules.rb file like
|
76
|
+
|
77
|
+
authorization do
|
78
|
+
role :guest do
|
79
|
+
#has_permission_on :welcome, :to => :read
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
privileges do
|
85
|
+
privilege :manage, :includes => [:create, :read, :update, :delete]
|
86
|
+
privilege :read, :includes => [:index, :show]
|
87
|
+
privilege :create, :includes => :new
|
88
|
+
privilege :update, :includes => :edit
|
89
|
+
privilege :delete, :includes => :destroy
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
** add filter_access_ro :all in a controller. When navigating to the controller an Access Denied message should be present.
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
= Licence
|
98
|
+
|
99
|
+
MIT
|
100
|
+
|
101
|
+
|
102
|
+
|
9
103
|
|
data/{config/locales/en.declarative_authorization.yml → en.declarative_authorization.dist.yml}
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycs-declarative_authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rubycs
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.
|
23
|
+
version: 2.2.0
|
24
24
|
version:
|
25
25
|
description:
|
26
26
|
email: rubycs@clair.ro
|
@@ -46,8 +46,7 @@ files:
|
|
46
46
|
- app/views/authorization_rules/graph.dot.erb
|
47
47
|
- app/views/authorization_rules/graph.html.erb
|
48
48
|
- config/routes.rb
|
49
|
-
-
|
50
|
-
- config/locales/ro.declarative_authorization.yml
|
49
|
+
- en.declarative_authorization.dist.yml
|
51
50
|
- lib/declarative_authorization.rb
|
52
51
|
- lib/declarative_authorization/in_controller.rb
|
53
52
|
- lib/declarative_authorization/reader.rb
|
@@ -1,35 +0,0 @@
|
|
1
|
-
ro:
|
2
|
-
declarative_authorization:
|
3
|
-
|
4
|
-
# app/controllers/authorization_rules_controller.rb
|
5
|
-
error_in_call_to_graphviz: Eroare generare imagine cu Graphviz
|
6
|
-
|
7
|
-
# app/helpers/authorization_rules_helper.rb
|
8
|
-
rules: Reguli
|
9
|
-
graphical_view: Vizualizare grafica
|
10
|
-
usages: Utilizari
|
11
|
-
no_filter_access_to_call_protects_this_action: Fara filter_access_to pentru a proteja aceasta actiune
|
12
|
-
action_is_not_protected_with_attribute_check: Aceasta actiune nu este protejat de attribute_check
|
13
|
-
privilege_set_automatically_from_action_name_by_all_rule: Privilegiile sunt setate intr-un mod automat din numele actiune de catre regula :all
|
14
|
-
context_set_automatically_from_controller_name_by_filter_access_to_call_without_context_option: Contextul este setat intr-un mod automatic de catre numele actiunii cu filter_access_to fara optiune de context setata
|
15
|
-
|
16
|
-
# app/views/authorization_rules/graph.html.erb
|
17
|
-
authorization_rules_graph: Grafica pentru regurile de autorizare
|
18
|
-
privilege_hierarchy: Ierarhia privilegiilor
|
19
|
-
currently_active_rules_in_this_application: Reguli active in aceasta aplicatie.
|
20
|
-
all_rules: Toate regurile
|
21
|
-
all_contexts: Toate contexturile
|
22
|
-
effective_privileges: Privilegii efective
|
23
|
-
show_full_privilege_hierarchy: Arata ierarhia completa de privilegii
|
24
|
-
zoom_in: Marire
|
25
|
-
zoom_out: Micsorare
|
26
|
-
|
27
|
-
# app/views/authorization_rules/index.html.erb
|
28
|
-
authorization_rules: Reguli de autorizare
|
29
|
-
|
30
|
-
# app/views/authorization_usages/index.html.erb
|
31
|
-
authorization_usage: Utilizarea regurilor de autorizare
|
32
|
-
filter_rules_in_actions_by_controller: Filtrare reguli de autorizare pe baza de controlleri
|
33
|
-
|
34
|
-
# lib/declarative_authorization/in_controller.rb
|
35
|
-
you_are_not_allowed_to_access_this_action: Nu aveti permisiunea de a acesa aceasta pagina
|