esp-permissions 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/esp_permissions/pagination.sass +2 -0
- data/app/controllers/esp_permissions/users_controller.rb +2 -3
- data/app/views/esp_permissions/permissions/new.html.erb +1 -1
- data/app/views/esp_permissions/users/index.html.erb +3 -0
- data/config/locales/ru.yml +10 -3
- data/lib/esp-permissions/version.rb +1 -1
- data/lib/generators/esp_permissions/install/install_generator.rb +4 -4
- data/lib/generators/esp_permissions/install/templates/app/models/user.rb +49 -0
- data/lib/generators/esp_permissions/install/templates/{migration.rb → db/migrate/esp_permissions_create_permissions.rb} +0 -0
- metadata +37 -36
@@ -15,7 +15,7 @@ class EspPermissions::UsersController < EspPermissions::ApplicationController
|
|
15
15
|
search_object.pagination = paginate_options
|
16
16
|
search_object.results
|
17
17
|
else
|
18
|
-
end_of_association_chain
|
18
|
+
end_of_association_chain.per(per_page)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -27,7 +27,6 @@ class EspPermissions::UsersController < EspPermissions::ApplicationController
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def per_page
|
30
|
-
|
30
|
+
10
|
31
31
|
end
|
32
|
-
|
33
32
|
end
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</h3>
|
8
8
|
<%= semantic_form_for resource, :url => esp_permissions.user_permissions_path(@user) do |form| %>
|
9
9
|
<%= form.inputs do %>
|
10
|
-
<%= form.input :context, :collection => current_user.
|
10
|
+
<%= form.input :context, :collection => current_user.available_contexts, :member_label => :context_title, :include_blank => t('permissions.not_selected') %>
|
11
11
|
<%= form.input :role, :as => :select, :collection => Permission.human_enums[:role].invert, :include_blank => t('permissions.not_selected') %>
|
12
12
|
<% end %>
|
13
13
|
<%= form.buttons :class => 'button-group' do %>
|
data/config/locales/ru.yml
CHANGED
@@ -2,11 +2,18 @@ ru:
|
|
2
2
|
activerecord:
|
3
3
|
attributes:
|
4
4
|
permission:
|
5
|
-
context:
|
6
|
-
role:
|
5
|
+
context: Категория
|
6
|
+
role: Роль
|
7
7
|
|
8
8
|
models:
|
9
|
-
permission:
|
9
|
+
permission: Право доступа
|
10
|
+
|
11
|
+
views:
|
12
|
+
pagination:
|
13
|
+
next: "→"
|
14
|
+
last: Последняя страница
|
15
|
+
previous: "←"
|
16
|
+
first: Первая страница
|
10
17
|
|
11
18
|
permissions:
|
12
19
|
'Are you sure?': Вы уверены, в том что хотите удалить запись?
|
@@ -12,12 +12,12 @@ module EspPermissions
|
|
12
12
|
Time.now.strftime('%Y%m%d%H%M%S')
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
def create_models
|
16
|
+
template 'app/models/user.rb'
|
17
|
+
end
|
18
18
|
|
19
19
|
def create_migration
|
20
|
-
migration_template '
|
20
|
+
migration_template 'db/migrate/esp_permissions_create_permissions.rb'
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
devise :omniauthable, :trackable, :timeoutable
|
3
|
+
attr_accessible :name, :email, :nickname, :first_name, :last_name, :location, :description, :image, :phone, :urls, :raw_info
|
4
|
+
|
5
|
+
has_many :permissions
|
6
|
+
|
7
|
+
searchable do
|
8
|
+
text :name, :email, :nickname, :phone
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.from_omniauth(hash)
|
12
|
+
User.find_or_initialize_by_uid(hash['uid']).tap do |user|
|
13
|
+
user.update_attributes hash['info']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def available_contexts
|
18
|
+
[]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
# == Schema Information
|
25
|
+
#
|
26
|
+
# Table name: users
|
27
|
+
#
|
28
|
+
# id :integer not null, primary key
|
29
|
+
# uid :string(255)
|
30
|
+
# name :text
|
31
|
+
# email :text
|
32
|
+
# nickname :text
|
33
|
+
# first_name :text
|
34
|
+
# last_name :text
|
35
|
+
# location :text
|
36
|
+
# description :text
|
37
|
+
# image :text
|
38
|
+
# phone :text
|
39
|
+
# urls :text
|
40
|
+
# raw_info :text
|
41
|
+
# sign_in_count :integer default(0)
|
42
|
+
# current_sign_in_at :datetime
|
43
|
+
# last_sign_in_at :datetime
|
44
|
+
# current_sign_in_ip :string(255)
|
45
|
+
# last_sign_in_ip :string(255)
|
46
|
+
# created_at :datetime
|
47
|
+
# updated_at :datetime
|
48
|
+
#
|
49
|
+
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esp-permissions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cancan
|
16
|
-
requirement: &
|
16
|
+
requirement: &17113940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17113940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: compass
|
27
|
-
requirement: &
|
27
|
+
requirement: &16983080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.12.alpha.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *16983080
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: formtastic
|
38
|
-
requirement: &
|
38
|
+
requirement: &16981780 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *16981780
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: has_enum
|
49
|
-
requirement: &
|
49
|
+
requirement: &16980020 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *16980020
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: has_searcher
|
60
|
-
requirement: &
|
60
|
+
requirement: &16977920 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *16977920
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: inherited_resources
|
71
|
-
requirement: &
|
71
|
+
requirement: &16976960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *16976960
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: kaminari
|
82
|
-
requirement: &
|
82
|
+
requirement: &16975640 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *16975640
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rails
|
93
|
-
requirement: &
|
93
|
+
requirement: &16952800 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *16952800
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: sass
|
104
|
-
requirement: &
|
104
|
+
requirement: &16951560 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *16951560
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: sass-rails
|
115
|
-
requirement: &
|
115
|
+
requirement: &16950560 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *16950560
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: sso_client
|
126
|
-
requirement: &
|
126
|
+
requirement: &16949780 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *16949780
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: sunspot_rails
|
137
|
-
requirement: &
|
137
|
+
requirement: &16948900 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *16948900
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: sqlite3
|
148
|
-
requirement: &
|
148
|
+
requirement: &16947380 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,10 +153,10 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *16947380
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: sunspot_solr
|
159
|
-
requirement: &
|
159
|
+
requirement: &16946000 !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
162
162
|
- - ! '>='
|
@@ -164,10 +164,10 @@ dependencies:
|
|
164
164
|
version: '0'
|
165
165
|
type: :development
|
166
166
|
prerelease: false
|
167
|
-
version_requirements: *
|
167
|
+
version_requirements: *16946000
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: uglifier
|
170
|
-
requirement: &
|
170
|
+
requirement: &16944760 !ruby/object:Gem::Requirement
|
171
171
|
none: false
|
172
172
|
requirements:
|
173
173
|
- - ! '>='
|
@@ -175,10 +175,10 @@ dependencies:
|
|
175
175
|
version: '0'
|
176
176
|
type: :development
|
177
177
|
prerelease: false
|
178
|
-
version_requirements: *
|
178
|
+
version_requirements: *16944760
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: therubyracer
|
181
|
-
requirement: &
|
181
|
+
requirement: &16944040 !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
184
184
|
- - ! '>='
|
@@ -186,7 +186,7 @@ dependencies:
|
|
186
186
|
version: '0'
|
187
187
|
type: :development
|
188
188
|
prerelease: false
|
189
|
-
version_requirements: *
|
189
|
+
version_requirements: *16944040
|
190
190
|
description: Description of EspPermissions.
|
191
191
|
email:
|
192
192
|
- mail@openteam.ru
|
@@ -214,7 +214,8 @@ files:
|
|
214
214
|
- config/routes.rb
|
215
215
|
- config/locales/ru.yml
|
216
216
|
- lib/generators/esp_permissions/install/install_generator.rb
|
217
|
-
- lib/generators/esp_permissions/install/templates/
|
217
|
+
- lib/generators/esp_permissions/install/templates/app/models/user.rb
|
218
|
+
- lib/generators/esp_permissions/install/templates/db/migrate/esp_permissions_create_permissions.rb
|
218
219
|
- lib/esp-permissions/engine.rb
|
219
220
|
- lib/esp-permissions/version.rb
|
220
221
|
- lib/tasks/esp-permissions_tasks.rake
|
@@ -236,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
236
237
|
version: '0'
|
237
238
|
segments:
|
238
239
|
- 0
|
239
|
-
hash:
|
240
|
+
hash: -556714408862913685
|
240
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
242
|
none: false
|
242
243
|
requirements:
|
@@ -245,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
246
|
version: '0'
|
246
247
|
segments:
|
247
248
|
- 0
|
248
|
-
hash:
|
249
|
+
hash: -556714408862913685
|
249
250
|
requirements: []
|
250
251
|
rubyforge_project:
|
251
252
|
rubygems_version: 1.8.10
|