diff --git a/app/assets/stylesheets/rooms.scss b/app/assets/stylesheets/rooms.scss index 1d037930..edcbbffb 100644 --- a/app/assets/stylesheets/rooms.scss +++ b/app/assets/stylesheets/rooms.scss @@ -69,3 +69,8 @@ .allow-icon-click{ pointer-events: auto; } + +.cant-create-rooms-title{ + align-items: center; + justify-content: center; +} diff --git a/app/controllers/recordings_controller.rb b/app/controllers/recordings_controller.rb index c82deff7..ad1c2806 100644 --- a/app/controllers/recordings_controller.rb +++ b/app/controllers/recordings_controller.rb @@ -50,10 +50,9 @@ class RecordingsController < ApplicationController # Ensure the user is logged into the room they are accessing. def verify_room_ownership - if !current_user || - !@room.owned_by?(current_user) || - !current_user.has_role?(:admin) || - !current_user.has_role?(:super_admin) + if !current_user || (!@room.owned_by?(current_user) && + !current_user.highest_priority_role.can_edit_site_settings && + !current_user.has_role?(:super_admin)) redirect_to root_path end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c138cba8..ce0b5fa2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -260,8 +260,8 @@ class UsersController < ApplicationController # Updates as user's roles def update_roles - # Check that the user can edit roles - if current_user.highest_priority_role.can_edit_roles + # Check that the user can manage users + if current_user.highest_priority_role.can_manage_users new_roles = params[:user][:role_ids].split(' ').map(&:to_i) old_roles = @user.roles.pluck(:id) diff --git a/app/views/rooms/cant_create_rooms.html.erb b/app/views/rooms/cant_create_rooms.html.erb index f3dbc98d..dd314f88 100644 --- a/app/views/rooms/cant_create_rooms.html.erb +++ b/app/views/rooms/cant_create_rooms.html.erb @@ -21,10 +21,11 @@
-
+

<%= t("room.no_room.title") %>

+

<%= t("room.no_room.description") %>

<%= form_for(:join_room, url: join_room_path) do |f| %>
diff --git a/app/views/shared/settings/_account.html.erb b/app/views/shared/settings/_account.html.erb index 298858e4..030deeea 100644 --- a/app/views/shared/settings/_account.html.erb +++ b/app/views/shared/settings/_account.html.erb @@ -46,7 +46,7 @@ <% @user.roles.by_priority.each do |role| %> " style="<%= "background-color: #{role_colour(role)};border-color: #{role_colour(role)};" %>" class="tag user-role-tag"> <%= translated_role_name(role) %> - <% if (current_user_role.can_edit_roles || current_user_role.name == "super_admin") && (role.priority > current_user_role.priority || current_user_role.name == "admin") %> + <% if (current_user_role.can_manage_users || current_user_role.name == "super_admin") && (role.priority > current_user_role.priority || current_user_role.name == "admin") %> @@ -54,7 +54,7 @@ <% end %>
- <% if current_user_role.can_edit_roles || current_user_role.name == "super_admin" %> + <% if current_user_role.can_manage_users || current_user_role.name == "super_admin" %> <% provider = Rails.configuration.loadbalanced_configuration ? current_user.provider : "greenlight" %> <%= f.select :roles, Role.editable_roles(@user_domain).map{|role| [translated_role_name(role), role.id, {'data-colour' => role_colour(role)}]}.unshift(["", nil, {'data-colour' => nil}]), {disabled: disabled_roles(@user)}, { class: "form-control custom-select", id: "role-select-dropdown" } %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index de9760ac..f4212d47 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -413,8 +413,9 @@ en: owner: Owner no_room: title: Join a Room - placeholder: Enter the room url or the room id for the room you want to join. + description: Enter the room url or the room id for the room you want to join. invalid_room_uid: The room url/uid you entered was invalid. + placeholder: Room url/uid no_sessions: This room has no sessions, yet! recordings: Room Recordings room_limit: You have reached the maximum number of rooms allowed diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 5af84f78..97c71ce5 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -341,7 +341,7 @@ describe UsersController, type: :controller do user_role = user.highest_priority_role - user_role.can_edit_roles = true + user_role.can_manage_users = true user_role.save! @@ -364,7 +364,7 @@ describe UsersController, type: :controller do user_role = user.highest_priority_role - user_role.can_edit_roles = true + user_role.can_manage_users = true user_role.save!