ch logika
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

This commit is contained in:
2026-09-18 11:53:37 +05:00
parent e0d03730de
commit d3e188affe
28 changed files with 405 additions and 656 deletions

View File

@@ -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)`