the_role 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rvmrc.example +1 -0
- data/Gemfile +0 -2
- data/README.md +53 -91
- data/app/assets/stylesheets/the_role/form.css +57 -55
- data/app/assets/stylesheets/the_role/headers.css.scss +14 -12
- data/app/assets/stylesheets/the_role/style.css.scss +68 -69
- data/app/controllers/admin/role_sections_controller.rb +55 -0
- data/app/controllers/admin/roles_controller.rb +11 -69
- data/app/views/admin/roles/_form.haml +3 -3
- data/app/views/admin/roles/edit.html.haml +39 -34
- data/app/views/admin/roles/index.haml +14 -8
- data/app/views/admin/roles/new.html.haml +22 -13
- data/config/locales/en.yml +34 -33
- data/config/locales/ru.yml +34 -33
- data/config/routes.rb +10 -12
- data/db/migrate/20111025025129_create_roles.rb +4 -4
- data/lib/the_role.rb +9 -104
- data/lib/the_role/hash.rb +22 -18
- data/lib/the_role/modules/base.rb +23 -0
- data/lib/the_role/modules/controller_requires.rb +28 -0
- data/lib/the_role/modules/param_helper.rb +7 -0
- data/lib/the_role/modules/role_model.rb +121 -0
- data/lib/the_role/modules/user_model.rb +32 -0
- data/lib/the_role/version.rb +1 -1
- data/pic.png +0 -0
- data/the_role.gemspec +4 -5
- metadata +39 -12
- data/app/assets/stylesheets/the_role/reset.css.scss +0 -63
- data/app/controllers/admin/role_section_controller.rb +0 -41
- data/app/views/layouts/the_role.html.haml +0 -15
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_role
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,44 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-04-05 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|
16
|
-
requirement: &
|
16
|
+
requirement: &70445940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70445940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sass
|
27
|
-
requirement: &
|
27
|
+
requirement: &70445730 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70445730
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: sass-rails
|
38
|
+
requirement: &70445520 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70445520
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: coffee-rails
|
49
|
+
requirement: &70445310 !ruby/object:Gem::Requirement
|
28
50
|
none: false
|
29
51
|
requirements:
|
30
52
|
- - ! '>='
|
@@ -32,7 +54,7 @@ dependencies:
|
|
32
54
|
version: '0'
|
33
55
|
type: :runtime
|
34
56
|
prerelease: false
|
35
|
-
version_requirements: *
|
57
|
+
version_requirements: *70445310
|
36
58
|
description: TheRole - simple, but powerful role system for ROR applications
|
37
59
|
email:
|
38
60
|
- zykin-ilya@ya.ru
|
@@ -41,21 +63,20 @@ extensions: []
|
|
41
63
|
extra_rdoc_files: []
|
42
64
|
files:
|
43
65
|
- .gitignore
|
66
|
+
- .rvmrc.example
|
44
67
|
- Gemfile
|
45
68
|
- MIT-LICENSE
|
46
69
|
- README.md
|
47
70
|
- Rakefile
|
48
71
|
- app/assets/stylesheets/the_role/form.css
|
49
72
|
- app/assets/stylesheets/the_role/headers.css.scss
|
50
|
-
- app/assets/stylesheets/the_role/reset.css.scss
|
51
73
|
- app/assets/stylesheets/the_role/style.css.scss
|
52
|
-
- app/controllers/admin/
|
74
|
+
- app/controllers/admin/role_sections_controller.rb
|
53
75
|
- app/controllers/admin/roles_controller.rb
|
54
76
|
- app/views/admin/roles/_form.haml
|
55
77
|
- app/views/admin/roles/edit.html.haml
|
56
78
|
- app/views/admin/roles/index.haml
|
57
79
|
- app/views/admin/roles/new.html.haml
|
58
|
-
- app/views/layouts/the_role.html.haml
|
59
80
|
- config/locales/en.yml
|
60
81
|
- config/locales/ru.yml
|
61
82
|
- config/routes.rb
|
@@ -64,8 +85,14 @@ files:
|
|
64
85
|
- lib/the_role.rb
|
65
86
|
- lib/the_role/engine.rb
|
66
87
|
- lib/the_role/hash.rb
|
88
|
+
- lib/the_role/modules/base.rb
|
89
|
+
- lib/the_role/modules/controller_requires.rb
|
90
|
+
- lib/the_role/modules/param_helper.rb
|
91
|
+
- lib/the_role/modules/role_model.rb
|
92
|
+
- lib/the_role/modules/user_model.rb
|
67
93
|
- lib/the_role/the_class_exists.rb
|
68
94
|
- lib/the_role/version.rb
|
95
|
+
- pic.png
|
69
96
|
- the_role.gemspec
|
70
97
|
homepage: https://github.com/the-teacher/the_role
|
71
98
|
licenses: []
|
@@ -87,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
114
|
version: '0'
|
88
115
|
requirements: []
|
89
116
|
rubyforge_project: the_role
|
90
|
-
rubygems_version: 1.8.
|
117
|
+
rubygems_version: 1.8.15
|
91
118
|
signing_key:
|
92
119
|
specification_version: 3
|
93
120
|
summary: TheRole - simple, but powerful role system
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/*18 aug 2011 */
|
2
|
-
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6,
|
3
|
-
p, img, font, pre, blockquote, i, b, u, s, strike, sub, sup, tt, big, small,
|
4
|
-
center, abbr, em, code, acronym, address, ins, del, strong, var, cite,
|
5
|
-
dfn, kbd, samp, dd, dl, dt, ol, ul, li, caption,
|
6
|
-
table, tbody, tfoot, thead, tr, th, td,
|
7
|
-
form, fieldset, legend, label,
|
8
|
-
article, aside, canvas, details, embed, figure, figcaption,
|
9
|
-
footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video{
|
10
|
-
margin:0;
|
11
|
-
padding:0;
|
12
|
-
border:0;
|
13
|
-
outline:0;
|
14
|
-
font-size:10px; /*zero-point*/
|
15
|
-
vertical-align:baseline;
|
16
|
-
background:transparent;
|
17
|
-
line-height:100%;
|
18
|
-
}
|
19
|
-
html, body, div, applet, object, iframe, img, p, pre, blockquote,
|
20
|
-
dd, dl, dt, ol, ul, li, caption, table, tbody, tfoot, thead, tr, th, td,
|
21
|
-
form, fieldset, legend, label{
|
22
|
-
font-weight:normal;
|
23
|
-
}
|
24
|
-
|
25
|
-
img, p, pre, blockquote, dd, dt, li, caption, legend, label{line-height:100%;}
|
26
|
-
table, tr, td{
|
27
|
-
vertical-align:top;
|
28
|
-
border-collapse:collapse;
|
29
|
-
border-spacing:0;
|
30
|
-
}
|
31
|
-
img{vertical-align:top;}
|
32
|
-
ol, ul{list-style:none; margin:0;}
|
33
|
-
li{list-style-position:outside;}
|
34
|
-
|
35
|
-
a{text-decoration:none;}
|
36
|
-
a:hover{text-decoration:none;}
|
37
|
-
|
38
|
-
sup, sub{font-size:85%; zoom:1;}
|
39
|
-
sup{vertical-align:40%;}
|
40
|
-
sub{vertical-align:-40%;}
|
41
|
-
:focus{outline:0;}
|
42
|
-
.overblock{overflow:hidden; zoom:1;}
|
43
|
-
.nobr{white-space:nowrap;}
|
44
|
-
.u{text-decoration:underline;}
|
45
|
-
noscript{color:red;}
|
46
|
-
/*basic LIST styles*/
|
47
|
-
.numered_list, .marked_list{margin-left:20px;}
|
48
|
-
.numered_list li, .marked_list li{
|
49
|
-
list-style-position: outside;
|
50
|
-
margin-left: 15px;
|
51
|
-
padding-left: 5px;
|
52
|
-
}
|
53
|
-
.numered_list li{list-style-type:decimal;}
|
54
|
-
.marked_list li{list-style-type:disc;}
|
55
|
-
/*Inherit*/
|
56
|
-
a, span, font, i, b, u, s, strike{ font-size: inherit; }
|
57
|
-
/*CUSTOM*/
|
58
|
-
img, p, pre, blockquote, dd, dt, caption, legend, label{
|
59
|
-
line-height:150%;
|
60
|
-
}
|
61
|
-
p, pre, blockquote{margin-bottom:15px;}
|
62
|
-
a{color:#8CA357;}
|
63
|
-
a:hover{text-decoration:underline;}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
class Admin::RoleSectionController < ApplicationController
|
2
|
-
before_filter :login_required
|
3
|
-
before_filter :the_role_require
|
4
|
-
|
5
|
-
before_filter :the_role_find, :only => [:destroy, :delete_policy]
|
6
|
-
before_filter :the_role_object, :only => [:destroy, :delete_policy]
|
7
|
-
before_filter :the_owner_require, :only => [:destroy, :delete_policy]
|
8
|
-
|
9
|
-
def destroy
|
10
|
-
section_name = params[:id]
|
11
|
-
role = TheRole.get(@role.the_role)
|
12
|
-
role.delete(section_name.to_sym)
|
13
|
-
|
14
|
-
if @role.update_attributes({:the_role => role.to_yaml})
|
15
|
-
flash[:notice] = t('the_role.section_deleted')
|
16
|
-
redirect_to edit_admin_role_path(@role)
|
17
|
-
else
|
18
|
-
render :action => :edit
|
19
|
-
end
|
20
|
-
end#destroy
|
21
|
-
|
22
|
-
def delete_policy
|
23
|
-
section_name = params[:id]
|
24
|
-
policy_name = params[:name]
|
25
|
-
role = TheRole.get(@role.the_role)
|
26
|
-
role[section_name.to_sym].delete(policy_name.to_sym)
|
27
|
-
|
28
|
-
if @role.update_attributes({:the_role => role.to_yaml})
|
29
|
-
flash[:notice] = t('the_role.section_policy_deleted')
|
30
|
-
redirect_to edit_admin_role_path(@role)
|
31
|
-
else
|
32
|
-
render :action => :edit
|
33
|
-
end
|
34
|
-
end#delete_policy
|
35
|
-
|
36
|
-
protected
|
37
|
-
|
38
|
-
def the_role_find
|
39
|
-
@role = Role.find(params[:role_id])
|
40
|
-
end
|
41
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
%html
|
3
|
-
%head
|
4
|
-
%title= yield(:title)
|
5
|
-
= stylesheet_link_tag 'the_role/reset'
|
6
|
-
= stylesheet_link_tag 'the_role/style'
|
7
|
-
= stylesheet_link_tag 'the_role/headers'
|
8
|
-
= stylesheet_link_tag 'the_role/form'
|
9
|
-
|
10
|
-
= javascript_include_tag :jquery
|
11
|
-
= javascript_include_tag :jquery_ujs
|
12
|
-
= csrf_meta_tags
|
13
|
-
|
14
|
-
%body
|
15
|
-
.body= yield
|