add admin policy

This commit is contained in:
sbriat 2023-02-13 11:53:30 +01:00
parent 4c591f4f30
commit 5bd860042e
3 changed files with 9 additions and 0 deletions

7
opa/admin/login.rego Normal file
View File

@ -0,0 +1,7 @@
package ADMIN.LOGIN
default allow := false
allow {
input.role == "admin"
}

View File

@ -4,4 +4,5 @@ export enum Action {
UPDATE = 'UPDATE',
DELETE = 'DELETE',
LIST = 'LIST',
LOGIN = 'LOGIN',
}

View File

@ -1,3 +1,4 @@
export enum Domain {
USER = 'USER',
ADMIN = 'ADMIN',
}