Files
triggerssmith/internal/acl/errors.go

28 lines
1.1 KiB
Go

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")
ErrRoleAlreadyAssigned = fmt.Errorf("role is already assigned to user")
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")
ErrResourceAlreadyAssigned = fmt.Errorf("resource is already assigned to role")
ErrRoleResourceNotFound = fmt.Errorf("assigned resource to role is not found")
ErrUserNotFound = fmt.Errorf("user not found")
ErrUserRoleNotFound = fmt.Errorf("user role not found")
)