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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6447a6a584d558778be4aff969ccae166dbfe52f
4
- data.tar.gz: 6400dfb57ed8ac906c4d8429f4c23ce81e6ec48a
3
+ metadata.gz: 847f1de2863b18cb9894d892f9c52dcb0563d309
4
+ data.tar.gz: 0d2a0cb043ec819d645fcdd3a41f9892792c63f7
5
5
  SHA512:
6
- metadata.gz: 29671d59a2bcf26aa9307089f4793ae8ed2d56fdd9acc278d8307f8a020c8e37418bf2f9b73ddba0e351d6fdddee4aee190a4ebc3da2039489baa00e77c6092b
7
- data.tar.gz: 648b05d5c52c8f1aa1550cb237b2734078d13b3b590872af8187d65e97bec36f0c20dd2aae3efa95ddef5ac66a56bd3b243980c4dfd0a74fb37a33b4f1a7510d
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
- application_filename = Rails.root.join *%w(config rbac.yml)
31
- filenames << application_filename if File.readable? application_filename#
32
- filenames
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::Rbac
2
- module Backend
3
- class PermissionsController < Itsf::Backend::Resource::BaseController
4
- def self.resource_class
5
- Ecm::Rbac::Permission
6
- end
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
- private
11
+ private
9
12
 
10
- def permitted_params
11
- params.require(:permission).reject! { |k,v| k == 'user_ids' }.permit(:identifier, :enabled_from, :enabled_to, role_ids: [])
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
@@ -2,6 +2,8 @@ module Ecm
2
2
  module Rbac
3
3
  module Backend
4
4
  class RolesController < Itsf::Backend::Resource::BaseController
5
+ include ResourcesController::Sorting
6
+
5
7
  def self.resource_class
6
8
  Ecm::Rbac::Role
7
9
  end
@@ -2,6 +2,8 @@ module Ecm
2
2
  module Rbac
3
3
  module Backend
4
4
  class UsersController < Itsf::Backend::Resource::BaseController
5
+ include ResourcesController::Sorting
6
+
5
7
  def self.resource_class
6
8
  Ecm::Rbac::Configuration.user_class
7
9
  end
@@ -1,5 +1,5 @@
1
1
  = table.row :identifier
2
- = table.row :enabled_from
3
- = table.row :enabled_to
4
- = table.row :created_at
5
- = table.row :updated_at
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, sortable: true
2
- = table.column :enabled?, sortable: true
3
- = table.column :enabled_from, sortable: true
4
- = table.column :enabled_to, sortable: true
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.row :enabled_from
3
- = table.row :enabled_to
4
- = table.row :created_at
5
- = table.row :updated_at
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, sortable: true
2
- = table.column :enabled?, sortable: true
3
- = table.column :enabled_from, sortable: true
4
- = table.column :enabled_to, sortable: true
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, sortable: true
2
- = table.column :roles_count, sortable: true
3
- = table.column :enabled_roles_count, sortable: true
4
- = table.column :permissions_count, sortable: true
5
- = table.column :enabled_permissions_count, sortable: true
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] do
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
@@ -1,7 +1,7 @@
1
1
  module Ecm
2
2
  module Rbac
3
3
  module Backend
4
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.1.0'.freeze
5
5
  end
6
6
  end
7
7
  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.0.0
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-02-15 00:00:00.000000000 Z
11
+ date: 2018-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails