para-acl 0.2.0.a → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/acl_roles_component.rb +5 -1
- data/app/controllers/{admin/para/acl/roles_component_controller.rb → para/acl/admin/acl_roles_component_controller.rb} +4 -4
- data/app/controllers/para/acl/admin/roles_controller.rb +9 -0
- data/app/decorators/acl_roles_component_decorator.rb +1 -5
- data/app/views/admin/para/acl/roles/_form.html.haml +2 -2
- data/app/views/{admin/para/acl/roles_component → para/acl/admin/acl_roles_component}/show.html.haml +3 -2
- data/lib/para/acl/ext/components_extension.rb +4 -7
- data/lib/para/acl/routes.rb +3 -3
- data/lib/para/acl/version.rb +1 -1
- metadata +7 -7
- data/app/controllers/admin/para/acl/role_resources_controller.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6831e21dedb07eaaa49215ebbbacd35cacdbabb5
|
4
|
+
data.tar.gz: 7cbc10e24b9a67e20cf2bf2e22b6c46c809e0e09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89aafe69c9079f39e77e6f7055218053dcf0658dbeda4154a757d853416f2e904a52f5709185263983b914ff2b5acba6c890d57e7808e0b52404d766b286d965
|
7
|
+
data.tar.gz: 73db47e95840e6576e51b9d7293fb3b6b78b9307f4b0069006ee90924f7674c1eb328853c5c8b2e82038a193eef112f4e1a0c1e7106311656eb998e53dc5d827
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AclRolesComponent < Para::Component::
|
1
|
+
class AclRolesComponent < Para::Component::Base
|
2
2
|
register :acl_roles, self
|
3
3
|
|
4
4
|
def resources
|
@@ -8,4 +8,8 @@ class AclRolesComponent < Para::Component::Crud
|
|
8
8
|
def model_type
|
9
9
|
'::Para::Acl::Role'
|
10
10
|
end
|
11
|
+
|
12
|
+
def model
|
13
|
+
@model ||= model_type.constantize
|
14
|
+
end
|
11
15
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module
|
2
|
-
module
|
3
|
-
module
|
4
|
-
class
|
1
|
+
module Para
|
2
|
+
module Acl
|
3
|
+
module Admin
|
4
|
+
class AclRolesComponentController < ::Para::Admin::ComponentController
|
5
5
|
def show
|
6
6
|
@components_roles = ::Para::Acl::ComponentRolesCollection.new
|
7
7
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
= para_form_for(resource) do |form|
|
1
|
+
= para_form_for(resource, url: @component.relation_path(:role, id: resource.id)) do |form|
|
2
2
|
= form.tabs do |tabs|
|
3
3
|
= tabs.tab :role do
|
4
4
|
= form.input :name
|
@@ -8,7 +8,7 @@
|
|
8
8
|
- if resource.persisted?
|
9
9
|
= tabs.tab :destroy_role do
|
10
10
|
= form.input :id, label: t('para.shared.destroy') do
|
11
|
-
= link_to @component.relation_path(resource), method: :delete, class: 'btn btn-danger', data: { confirm: t('admin.acl_roles.destroy', role: resource.name) } do
|
11
|
+
= link_to @component.relation_path(:role, id: resource.id), method: :delete, class: 'btn btn-danger', data: { confirm: t('admin.acl_roles.destroy', role: resource.name) } do
|
12
12
|
= fa_icon 'times'
|
13
13
|
= t('para.shared.destroy')
|
14
14
|
|
data/app/views/{admin/para/acl/roles_component → para/acl/admin/acl_roles_component}/show.html.haml
RENAMED
@@ -9,7 +9,8 @@
|
|
9
9
|
= para_form_for @components_roles, url: @component.path, as: :components_roles do |form|
|
10
10
|
= panel do |panel|
|
11
11
|
= panel.header do
|
12
|
-
=
|
12
|
+
= icon_link_to t('para.shared.add'), @component.relation_path(:role, action: :new), icon: 'plus', class: 'btn btn-primary add-button'
|
13
|
+
|
13
14
|
|
14
15
|
= resources_table(component: @component, model: @component.model, actions: false) do |table|
|
15
16
|
= table.header do
|
@@ -17,7 +18,7 @@
|
|
17
18
|
|
18
19
|
- @components_roles.roles.each do |role|
|
19
20
|
= table.header_for do
|
20
|
-
= link_to @component.relation_path(role, action: :edit) do
|
21
|
+
= link_to @component.relation_path(:role, id: role.id, action: :edit) do
|
21
22
|
= role.name
|
22
23
|
= fa_icon 'pencil'
|
23
24
|
|
@@ -4,13 +4,10 @@ module Para
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
def clean_role_components
|
13
|
-
::Para::Acl::RoleComponent.where(component: self).destroy_all
|
7
|
+
has_many :role_components, class_name: 'Para::Acl::RoleComponent',
|
8
|
+
foreign_key: :component_id,
|
9
|
+
dependent: :destroy
|
10
|
+
has_many :roles, through: :role_components
|
14
11
|
end
|
15
12
|
end
|
16
13
|
end
|
data/lib/para/acl/routes.rb
CHANGED
@@ -3,9 +3,9 @@ module Para
|
|
3
3
|
class Routes < Para::Plugins::Routes
|
4
4
|
def draw
|
5
5
|
plugin :acl do
|
6
|
-
component :
|
7
|
-
|
8
|
-
|
6
|
+
component :acl_roles, path: :roles, actions: [:show, :update] do
|
7
|
+
resources :roles
|
8
|
+
end
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/para/acl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: para-acl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valentin Ballestrino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: para
|
@@ -92,14 +92,14 @@ files:
|
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- app/components/acl_roles_component.rb
|
95
|
-
- app/controllers/
|
96
|
-
- app/controllers/
|
95
|
+
- app/controllers/para/acl/admin/acl_roles_component_controller.rb
|
96
|
+
- app/controllers/para/acl/admin/roles_controller.rb
|
97
97
|
- app/decorators/acl_roles_component_decorator.rb
|
98
98
|
- app/models/para/acl/role.rb
|
99
99
|
- app/models/para/acl/role_component.rb
|
100
100
|
- app/models/para/acl/user_role.rb
|
101
101
|
- app/views/admin/para/acl/roles/_form.html.haml
|
102
|
-
- app/views/
|
102
|
+
- app/views/para/acl/admin/acl_roles_component/show.html.haml
|
103
103
|
- bin/rails
|
104
104
|
- config/locales/fr.yml
|
105
105
|
- db/migrate/20151215160816_create_para_acl_roles.rb
|
@@ -138,9 +138,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- - "
|
141
|
+
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
146
|
rubygems_version: 2.5.1
|