Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/api/unit_roles_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ class UnitRolesApi < Grape::API

# Once they're an observer, they'll no longer have access to this route to remove the observer status from themselves
# But let's double check just in case this route gets whitelisted...
if unit_role.observer_only

unit = unit_role.unit
current_unit_role = unit.unit_role_for(current_user)

if current_unit_role.observer_only
error!({ error: "You are not authorised to update this staff member." }, 403)
end

Expand Down