forked from External/greenlight
GRN2-385: Recording permission tied to role cleanup (#2812)
* Code cleanup * String change
This commit is contained in:
parent
c46980c84c
commit
f013e2b529
|
@ -31,8 +31,6 @@ class AdminsController < ApplicationController
|
|||
before_action :find_deleted_user, only: manage_deleted_users
|
||||
before_action :verify_admin_of_user, only: [manage_users, manage_deleted_users]
|
||||
|
||||
helper_method :perm_to_record_meeting
|
||||
|
||||
# GET /admins
|
||||
def index
|
||||
# Initializa the data manipulation variables
|
||||
|
|
|
@ -123,15 +123,6 @@ module Recorder
|
|||
end
|
||||
end
|
||||
|
||||
def perm_to_record_meeting
|
||||
# define perm without init config of room setting
|
||||
if recording_consent_required?
|
||||
@settings.get_value("Room Configuration Recording") != "disabled" && current_user&.role&.get_permission("can_launch_recording")
|
||||
else
|
||||
current_user&.role&.get_permission("can_launch_recording")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Gets the email of the room owner to which the recording belongs to
|
||||
|
|
|
@ -35,8 +35,6 @@ class RoomsController < ApplicationController
|
|||
before_action :verify_user_not_admin, only: [:show]
|
||||
skip_before_action :verify_authenticity_token, only: [:join]
|
||||
|
||||
helper_method :perm_to_record_meeting
|
||||
|
||||
# POST /
|
||||
def create
|
||||
# Return to root if user is not signed in
|
||||
|
|
|
@ -137,4 +137,14 @@ module ApplicationHelper
|
|||
return "" if date.nil? # Handle invalid dates
|
||||
local_time(date, :default)
|
||||
end
|
||||
|
||||
# Returns true if the user is allowed to record meetings
|
||||
def perm_to_record_meeting
|
||||
if recording_consent_required?
|
||||
@settings.get_value("Room Configuration Recording") != "disabled" &&
|
||||
current_user&.role&.get_permission("can_launch_recording")
|
||||
else
|
||||
current_user&.role&.get_permission("can_launch_recording")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -145,7 +145,7 @@ en:
|
|||
roles:
|
||||
appear_in_share_list: Include users with this role in the dropdown for sharing rooms
|
||||
can_create_rooms: Can create rooms
|
||||
can_launch_recording: Allow users with this role to launch recordings
|
||||
can_launch_recording: Allow users with this role to record their meetings
|
||||
delete: Delete the role
|
||||
invalid_create: There was a problem creating a new role. Please check the role values and try again
|
||||
invalid_order: There was a problem updating the priority of the role. Please check the values and try again
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_01_08_032132) do
|
||||
ActiveRecord::Schema.define(version: 2021_03_19_160827) do
|
||||
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
|
|
Loading…
Reference in New Issue