From 3d47b7623fbe9b47d749cbc285f63de5eebcc00c Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Fri, 31 Mar 2017 16:28:21 +1100 Subject: [PATCH 1/2] [MNOE-399] Add ACL and settings --- .../mno_enterprise/config.js.coffee.erb | 1 + .../jpi/v1/audit_events_controller.rb | 2 ++ .../install/templates/config/settings.yml | 19 +++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb b/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb index 6f90a0a0f..180bec821 100644 --- a/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb +++ b/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb @@ -17,6 +17,7 @@ angular.module('mnoEnterprise.configuration', []) .constant('PAYMENT_CONFIG', <%= Hash(Settings.payment).to_json %>) .constant('ORGANIZATION_MANAGEMENT', <%= Hash(Settings.organization_management).to_json %>) .constant('USER_MANAGEMENT', <%= Hash(Settings.user_management).to_json %>) + .constant('AUDIT_LOG', <%= Hash(Settings.user_management).to_json %>) .constant('GOOGLE_TAG_CONTAINER_ID', <%= MnoEnterprise.google_tag_container.to_json %>) .constant('INTERCOM_ID', <%= MnoEnterprise.intercom_app_id.to_json %>) .constant('APP_NAME', <%= MnoEnterprise.app_name.to_json %>) diff --git a/api/app/controllers/mno_enterprise/jpi/v1/audit_events_controller.rb b/api/app/controllers/mno_enterprise/jpi/v1/audit_events_controller.rb index 4ab327bb8..81d4d147e 100644 --- a/api/app/controllers/mno_enterprise/jpi/v1/audit_events_controller.rb +++ b/api/app/controllers/mno_enterprise/jpi/v1/audit_events_controller.rb @@ -5,6 +5,8 @@ class Jpi::V1::AuditEventsController < Jpi::V1::BaseResourceController def index @organization = MnoEnterprise::Organization.find(params.require(:organization_id)) + authorize! :manage, @organization + @audit_events = MnoEnterprise::AuditEvent.where(organization_id: @organization.id) @audit_events = @audit_events.limit(params[:limit]) if params[:limit] @audit_events = @audit_events.skip(params[:offset]) if params[:offset] diff --git a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml index b1fc787ca..36710f05f 100644 --- a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml +++ b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml @@ -11,7 +11,9 @@ frontend_host: #=============================================== # Feature Flags #=============================================== - +# Display Audit Log in Organization Panel +audit_log: + enabled: false # Display App Pricing on Marketplace pricing: enabled: false @@ -47,17 +49,18 @@ devise: # Admin Panel Config admin_panel: - # Disable Impersonation - impersonation: - disabled: false - staff: - enabled: true - finance: - enabled: true apps_management: enabled: true + audit_log: + enabled: true customer_management: organization: enabled: true user: enabled: true + finance: + enabled: true + impersonation: + disabled: false + staff: + enabled: true From c3c7d95ee3f9f51d5cc9d3a77f5a05c39d1772d1 Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Fri, 31 Mar 2017 17:16:01 +1100 Subject: [PATCH 2/2] Code Review --- api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb | 2 +- .../mno_enterprise/install/templates/config/settings.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb b/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb index 180bec821..714961cf1 100644 --- a/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb +++ b/api/app/assets/javascripts/mno_enterprise/config.js.coffee.erb @@ -17,7 +17,7 @@ angular.module('mnoEnterprise.configuration', []) .constant('PAYMENT_CONFIG', <%= Hash(Settings.payment).to_json %>) .constant('ORGANIZATION_MANAGEMENT', <%= Hash(Settings.organization_management).to_json %>) .constant('USER_MANAGEMENT', <%= Hash(Settings.user_management).to_json %>) - .constant('AUDIT_LOG', <%= Hash(Settings.user_management).to_json %>) + .constant('AUDIT_LOG', <%= Hash(Settings.audit_log).to_json %>) .constant('GOOGLE_TAG_CONTAINER_ID', <%= MnoEnterprise.google_tag_container.to_json %>) .constant('INTERCOM_ID', <%= MnoEnterprise.intercom_app_id.to_json %>) .constant('APP_NAME', <%= MnoEnterprise.app_name.to_json %>) diff --git a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml index 36710f05f..ebaf810dd 100644 --- a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml +++ b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml @@ -11,7 +11,7 @@ frontend_host: #=============================================== # Feature Flags #=============================================== -# Display Audit Log in Organization Panel +# Do not display Audit Log in Organization Panel audit_log: enabled: false # Display App Pricing on Marketplace