Documentation ¶
Index ¶
- Variables
- type AccessPair
- type Filter
- type PolicyService
- type RelationService
- type Repository
- type RoleService
- type Service
- func (s Service) Create(ctx context.Context, user User) (User, error)
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) Disable(ctx context.Context, id string) error
- func (s Service) Enable(ctx context.Context, id string) error
- func (s Service) GetByEmail(ctx context.Context, email string) (User, error)
- func (s Service) GetByID(ctx context.Context, id string) (User, error)
- func (s Service) GetByIDs(ctx context.Context, userIDs []string) ([]User, error)
- func (s Service) IsSudo(ctx context.Context, id string, permissionName string) (bool, error)
- func (s Service) IsSudos(ctx context.Context, ids []string, permissionName string) ([]relation.Relation, error)
- func (s Service) List(ctx context.Context, flt Filter) ([]User, error)
- func (s Service) ListByGroup(ctx context.Context, groupID string, roleFilter string) ([]User, error)
- func (s Service) ListByOrg(ctx context.Context, orgID string, roleFilter string) ([]User, error)
- func (s Service) Sudo(ctx context.Context, id string, relationName string) error
- func (s Service) UnSudo(ctx context.Context, id string) error
- func (s Service) Update(ctx context.Context, toUpdate User) (User, error)
- func (s Service) UpdateByEmail(ctx context.Context, toUpdate User) (User, error)
- type State
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotExist = errors.New("user doesn't exist") ErrInvalidID = errors.New("user id is invalid") ErrInvalidEmail = errors.New("user email is invalid") ErrConflict = errors.New("user already exist") ErrInvalidDetails = errors.New("invalid user details (name|email)") ErrMissingName = errors.New("user name is missing") ErrEmptyKey = errors.New("empty key") ErrKeyAlreadyExists = errors.New("key already exist") ErrKeyDoesNotExists = errors.New("key does not exist") ErrMissingEmail = errors.New("user email is missing") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrDisabled = errors.New("user is disabled") )
Functions ¶
This section is empty.
Types ¶
type AccessPair ¶ added in v0.7.5
type PolicyService ¶ added in v0.7.19
type RelationService ¶
type RelationService interface { Create(ctx context.Context, rel relation.Relation) (relation.Relation, error) BatchCheckPermission(ctx context.Context, relations []relation.Relation) ([]relation.CheckPair, error) Delete(ctx context.Context, rel relation.Relation) error LookupSubjects(ctx context.Context, rel relation.Relation) ([]string, error) LookupResources(ctx context.Context, rel relation.Relation) ([]string, error) }
type Repository ¶
type Repository interface { GetByID(ctx context.Context, id string) (User, error) GetByEmail(ctx context.Context, email string) (User, error) GetByIDs(ctx context.Context, userIds []string) ([]User, error) GetByName(ctx context.Context, name string) (User, error) Create(ctx context.Context, user User) (User, error) List(ctx context.Context, flt Filter) ([]User, error) UpdateByID(ctx context.Context, toUpdate User) (User, error) UpdateByName(ctx context.Context, toUpdate User) (User, error) UpdateByEmail(ctx context.Context, toUpdate User) (User, error) Delete(ctx context.Context, id string) error SetState(ctx context.Context, id string, state State) error }
type RoleService ¶ added in v0.8.0
type Service ¶
func NewService ¶
func NewService(repository Repository, relationRepo RelationService, policyService PolicyService, roleService RoleService) *Service
func (Service) GetByEmail ¶
func (Service) IsSudo ¶
IsSudo checks platform permissions. Platform permissions are: - superuser - check
func (Service) ListByGroup ¶
func (Service) UnSudo ¶ added in v0.14.0
UnSudo remove platform permissions to user only remove the 'member' relation if it exists
Click to show internal directories.
Click to hide internal directories.