basicly implement acl crud ops with roles and resources

This commit is contained in:
2025-12-20 17:38:15 +02:00
parent c188b46519
commit 904f446447
18 changed files with 1607 additions and 324 deletions

21
internal/acl/errors.go Normal file
View File

@@ -0,0 +1,21 @@
package acl
// TODO: add more specific errors
import "fmt"
var (
ErrNotInitialized = fmt.Errorf("acl service is not initialized")
ErrRoleNotFound = fmt.Errorf("role not found")
ErrRoleAlreadyExists = fmt.Errorf("role already exists")
ErrInvalidRoleName = fmt.Errorf("role name is invalid")
ErrSameRoleName = fmt.Errorf("role name is the same as another role")
ErrRoleInUse = fmt.Errorf("role is in use")
ErrResourceNotFound = fmt.Errorf("resource not found")
ErrResourceAlreadyExists = fmt.Errorf("resource already exists")
ErrInvalidResourceKey = fmt.Errorf("invalid resource key")
ErrResourceInUse = fmt.Errorf("resource is in use")
ErrSameResourceKey = fmt.Errorf("resource key is the same as another resource")
)