App platform: Implement perm check with direct db access (#97579)

* implement perm check with direct db access

* add tests

* more tests

* Update pkg/services/authz/rbac/service.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update pkg/services/authz/rbac/service.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* allow fetching permissions for a user who is not a member of the org

* linting

* fix typo

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
Ieva
2024-12-12 08:52:14 +00:00
committed by GitHub
parent 3c78fb1aa4
commit ded90fa28d
29 changed files with 796 additions and 16 deletions
@@ -0,0 +1,4 @@
SELECT COALESCE(ou.role, 'None') AS role, u.is_admin
FROM {{ .Ident .UserTable }} as u
LEFT JOIN {{ .Ident .OrgUserTable }} as ou ON ou.user_id = u.id AND ou.org_id = {{ .Arg .Query.OrgID }}
WHERE u.id = {{ .Arg .Query.UserID }}