ecm_rbac_backend 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb +9 -14
- data/app/controllers/ecm/rbac/backend/permissions_controller.rb +14 -10
- data/app/controllers/ecm/rbac/backend/roles_controller.rb +2 -0
- data/app/controllers/ecm/rbac/backend/users_controller.rb +2 -0
- data/app/views/ecm/rbac/backend/permissions/_show.haml +4 -4
- data/app/views/ecm/rbac/backend/permissions/_table.haml +5 -5
- data/app/views/ecm/rbac/backend/roles/_show.haml +4 -4
- data/app/views/ecm/rbac/backend/roles/_table.haml +5 -5
- data/app/views/ecm/rbac/backend/users/_table.haml +6 -6
- data/config/routes.rb +1 -4
- data/lib/ecm/rbac/backend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 847f1de2863b18cb9894d892f9c52dcb0563d309
|
4
|
+
data.tar.gz: 0d2a0cb043ec819d645fcdd3a41f9892792c63f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb5666e74e5be611b089b968217a08cd6c42a945feb0a15f4f0f4fe97853377c894aa88e6b6f9c40fcefd6f9ea6393174006cf6729da71c2da50d3c700a29b2d
|
7
|
+
data.tar.gz: aad7998d05467619bcde74d1cab1387980d8e35b3d7bd39b8607b9f856cd4cb26bd7f73fb74e78c79b7ab6b6655b5947e73086cad1e27c2ed28f1e82bef40fbf
|
@@ -1,20 +1,12 @@
|
|
1
1
|
module Ecm::Rbac
|
2
2
|
module Backend
|
3
3
|
class ImportDefaultPermissionsServiceController < Itsf::Backend::Service::BaseController
|
4
|
+
before_action :load_filenames, only: [:new, :create]
|
5
|
+
|
4
6
|
def self.service_class
|
5
7
|
Ecm::Rbac::ImportDefaultPermissionsService
|
6
8
|
end
|
7
9
|
|
8
|
-
def invoke
|
9
|
-
@filenames = load_filenames
|
10
|
-
super
|
11
|
-
end
|
12
|
-
|
13
|
-
def call
|
14
|
-
@filenames = load_filenames
|
15
|
-
super
|
16
|
-
end
|
17
|
-
|
18
10
|
private
|
19
11
|
|
20
12
|
def permitted_params
|
@@ -22,14 +14,17 @@ module Ecm::Rbac
|
|
22
14
|
end
|
23
15
|
|
24
16
|
def load_filenames
|
25
|
-
filenames = ::Rails::Engine.subclasses.map(&:instance).collect do |engine|
|
17
|
+
@filenames = ::Rails::Engine.subclasses.map(&:instance).collect do |engine|
|
26
18
|
filename = engine.root.join *%w(config rbac.yml)
|
27
19
|
next unless File.readable? filename
|
28
20
|
filename
|
29
21
|
end.compact
|
30
|
-
|
31
|
-
filenames << application_filename if File.readable? application_filename
|
32
|
-
|
22
|
+
|
23
|
+
@filenames << application_filename if File.readable? application_filename
|
24
|
+
end
|
25
|
+
|
26
|
+
def application_filename
|
27
|
+
Rails.root.join *%w(config rbac.yml)
|
33
28
|
end
|
34
29
|
end
|
35
30
|
end
|
@@ -1,15 +1,19 @@
|
|
1
|
-
module Ecm
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
module Ecm
|
2
|
+
module Rbac
|
3
|
+
module Backend
|
4
|
+
class PermissionsController < Itsf::Backend::Resource::BaseController
|
5
|
+
include ResourcesController::Sorting
|
6
|
+
|
7
|
+
def self.resource_class
|
8
|
+
Ecm::Rbac::Permission
|
9
|
+
end
|
7
10
|
|
8
|
-
|
11
|
+
private
|
9
12
|
|
10
|
-
|
11
|
-
|
13
|
+
def permitted_params
|
14
|
+
params.require(:permission).reject! { |k,v| k == 'user_ids' }.permit(:identifier, :enabled_from, :enabled_to, role_ids: [])
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
15
|
-
end
|
19
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
= table.row :identifier
|
2
|
-
= table.
|
3
|
-
= table.
|
4
|
-
= table.
|
5
|
-
= table.
|
2
|
+
= table.boolean :enabled?
|
3
|
+
= table.timestamp :enabled_from
|
4
|
+
= table.timestamp :enabled_to
|
5
|
+
= table.timestamps
|
@@ -1,5 +1,5 @@
|
|
1
|
-
= table.column :identifier,
|
2
|
-
= table.
|
3
|
-
= table.
|
4
|
-
= table.
|
5
|
-
= table.timestamps
|
1
|
+
= table.column :identifier, sort: true
|
2
|
+
= table.boolean :enabled?
|
3
|
+
= table.timestamp :enabled_from, sort: true
|
4
|
+
= table.timestamp :enabled_to, sort: true
|
5
|
+
= table.timestamps(sort: true)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
= table.row :identifier
|
2
|
-
= table.
|
3
|
-
= table.
|
4
|
-
= table.
|
5
|
-
= table.
|
2
|
+
= table.boolean :enabled?
|
3
|
+
= table.timestamp :enabled_from
|
4
|
+
= table.timestamp :enabled_to
|
5
|
+
= table.timestamps
|
@@ -1,5 +1,5 @@
|
|
1
|
-
= table.column :identifier,
|
2
|
-
= table.
|
3
|
-
= table.
|
4
|
-
= table.
|
5
|
-
= table.timestamps
|
1
|
+
= table.column :identifier, sort: true
|
2
|
+
= table.boolean :enabled?
|
3
|
+
= table.timestamp :enabled_from, sort: true
|
4
|
+
= table.timestamp :enabled_to, sort: true
|
5
|
+
= table.timestamps(sort: true)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
= table.column :email,
|
2
|
-
= table.column :roles_count,
|
3
|
-
= table.column :enabled_roles_count,
|
4
|
-
= table.column :permissions_count,
|
5
|
-
= table.column :enabled_permissions_count,
|
6
|
-
= table.timestamps
|
1
|
+
= table.column :email, sort: true
|
2
|
+
= table.column :roles_count, sort: true
|
3
|
+
= table.column :enabled_roles_count, sort: true
|
4
|
+
= table.column :permissions_count, sort: true
|
5
|
+
= table.column :enabled_permissions_count, sort: true
|
6
|
+
= table.timestamps sort: true
|
data/config/routes.rb
CHANGED
@@ -3,10 +3,7 @@ Ecm::Rbac::Backend::Engine.routes.draw do
|
|
3
3
|
resources :roles
|
4
4
|
resources :users, except: [:create, :new, :destroy]
|
5
5
|
|
6
|
-
resources :import_default_permissions_service, only: [:index]
|
7
|
-
get :invoke, on: :collection
|
8
|
-
post :call, on: :collection
|
9
|
-
end
|
6
|
+
resources :import_default_permissions_service, only: [:index, :new, :create]
|
10
7
|
|
11
8
|
root to: 'home#index'
|
12
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_rbac_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|