GRN2-260: Added the ability to merge user accounts (#938)

* Added the ability to merge user accounts

* Styling fixes
This commit is contained in:
Ahmad Farhat
2020-02-14 10:24:06 -05:00
committed by GitHub
parent 31258272c2
commit 005c738e4d
13 changed files with 222 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class Ability
if highest_role.get_permission("can_manage_users")
can [:index, :roles, :edit_user, :promote, :demote, :ban_user, :unban_user,
:approve, :invite, :reset, :undelete], :admin
:approve, :invite, :reset, :undelete, :merge_user], :admin
end
can [:index, :server_recordings, :server_rooms], :admin if highest_role.get_permission("can_manage_rooms_recordings")

View File

@ -60,6 +60,11 @@ class Room < ApplicationRecord
user.rooms.include?(self)
end
# Determines whether room is a home room
def home_room?
owner.main_room == self
end
def shared_users
User.where(id: shared_access.pluck(:user_id))
end