Skip to content

Commit 1b441dd

Browse files
committed
fix(utilities/permissions): should select highest permisson first
unless there is an explicit deny
1 parent f9ae7e9 commit 1b441dd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/placeos-rest-api/utilities/permissions.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ module PlaceOS::Api::Utils::Permissions
2626
case
2727
when (is_deny = deny.try(&.map!(&.downcase))) && !(is_deny & groups).empty?
2828
{false, Permission::Deny}
29-
when (can_manage = manage.try(&.map!(&.downcase))) && !(can_manage & groups).empty?
30-
{true, Permission::Manage}
3129
when (can_admin = admin.try(&.map!(&.downcase))) && !(can_admin & groups).empty?
3230
{true, Permission::Admin}
31+
when (can_manage = manage.try(&.map!(&.downcase))) && !(can_manage & groups).empty?
32+
{true, Permission::Manage}
3333
else
3434
{true, Permission::None}
3535
end

0 commit comments

Comments
 (0)