scripts: access-portal: Fix incorrect bitmask checking for media roles

In Lua, `0` is a truthy value, which means `not 0` is `false`. Compare
the resulting value from bitwise AND with 0 instead of checking it with
`if not` to ensure correctness.
This commit is contained in:
msizanoen1 2022-04-15 13:20:27 +07:00
parent 018ccb9ce6
commit a2472542a9

View file

@ -74,7 +74,7 @@ function updateClientPermissions (client, permissions)
return
end
media_roles = parseMediaRoles (str_prop)
if not (media_roles & MEDIA_ROLE_CAMERA) then
if (media_roles & MEDIA_ROLE_CAMERA) == 0 then
Log.info (client, "Ignoring portal check for clients without camera role")
return
end