forked from External/greenlight
GRN2-128: Added the ability to manage rooms (#848)
* Added the ability to manage rooms * Small fixes * Fixed travis complaints * Fixed issues with role permissions * Fixed issue with delete room * Fixed rubocop and added testcases
This commit is contained in:
committed by
farhatahmad
parent
984e5cc085
commit
09de6b6739
@ -0,0 +1,28 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MigrationProduct < ActiveRecord::Base
|
||||
self.table_name = :roles
|
||||
end
|
||||
|
||||
class SubMigrationProduct < ActiveRecord::Base
|
||||
self.table_name = :role_permissions
|
||||
end
|
||||
|
||||
class AddManageRoomRecordingsToPermissions < 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_manage_rooms_recordings",
|
||||
value: SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_users").value, enabled: true)
|
||||
end
|
||||
end
|
||||
|
||||
dir.down do
|
||||
MigrationProduct.all.each do |role|
|
||||
SubMigrationProduct.find_by(role_id: role.id, name: "can_manage_rooms_recordings").destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_08_28_153347) do
|
||||
ActiveRecord::Schema.define(version: 2019_10_23_172511) do
|
||||
|
||||
create_table "features", force: :cascade do |t|
|
||||
t.integer "setting_id"
|
||||
|
Reference in New Issue
Block a user