forked from External/greenlight
Feat: recording perm (#2775)
* fix: comment into code not related - abusive copy/paste * Add user permission for recording Add a role permission 'can_launch_record' to users to set the ability to run recording. By default everybody can record, but we can set to the user role without perm to record and create a new role for those who can.
This commit is contained in:
committed by
GitHub
parent
e0775122d4
commit
a7ecd54381
@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MigrationProduct < ActiveRecord::Base
|
||||
self.table_name = :roles
|
||||
end
|
||||
|
||||
class SubMigrationProduct < ActiveRecord::Base
|
||||
self.table_name = :role_permissions
|
||||
end
|
||||
|
||||
class AddCanLaunchRecordingToPermissions < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
MigrationProduct.all.each do |role|
|
||||
SubMigrationProduct.create(role_id: role.id, name: "can_launch_recording", value: 'true', enabled: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user