ch logika
This commit is contained in:
@@ -67,19 +67,9 @@ const userPermissionsJSON = `COALESCE((
|
||||
) ORDER BY p.module, p.id)
|
||||
FROM permissions p
|
||||
WHERE p.deleted_at IS NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM permission_user pu
|
||||
WHERE pu.user_id = u.id AND pu.permission_id = p.id AND pu.effect = 'deny' AND pu.deleted_at IS NULL
|
||||
)
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM permission_user pu
|
||||
WHERE pu.user_id = u.id AND pu.permission_id = p.id AND pu.effect = 'allow' AND pu.deleted_at IS NULL
|
||||
)
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM permission_role pr
|
||||
WHERE pr.role_id = r.id AND pr.permission_id = p.id AND pr.deleted_at IS NULL
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM permission_role pr
|
||||
WHERE pr.role_id = r.id AND pr.permission_id = p.id AND pr.deleted_at IS NULL
|
||||
)
|
||||
), '[]'::json)`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user