Documentation
¶
Index ¶
- type AccessControlService
- func (s *AccessControlService) EnsurePermissions(ctx context.Context, permissions []rootservices.PermissionDefinition) error
- func (s *AccessControlService) RoleExists(ctx context.Context, roleName string) (bool, error)
- func (s *AccessControlService) ValidatePermissionKeys(ctx context.Context, permissionKeys []string) error
- func (s *AccessControlService) ValidateRoleAssignment(ctx context.Context, roleName string, assignerUserID *string) (bool, error)
- type PermissionsService
- func (s *PermissionsService) CreatePermission(ctx context.Context, actor *models.Actor, req types.CreatePermissionRequest) (*types.Permission, error)
- func (s *PermissionsService) DeletePermission(ctx context.Context, actor *models.Actor, permissionID string) error
- func (s *PermissionsService) GetAllPermissions(ctx context.Context, actor *models.Actor) ([]types.Permission, error)
- func (s *PermissionsService) GetPermissionByID(ctx context.Context, actor *models.Actor, permissionID string) (*types.Permission, error)
- func (s *PermissionsService) GetPermissionByKey(ctx context.Context, actor *models.Actor, permissionKey string) (*types.Permission, error)
- func (s *PermissionsService) UpdatePermission(ctx context.Context, actor *models.Actor, permissionID string, ...) (*types.Permission, error)
- type RolePermissionsService
- func (s *RolePermissionsService) AddPermissionToRole(ctx context.Context, actor *models.Actor, roleID string, permissionID string, ...) error
- func (s *RolePermissionsService) GetRolePermissions(ctx context.Context, actor *models.Actor, roleID string) ([]types.UserPermissionInfo, error)
- func (s *RolePermissionsService) RemovePermissionFromRole(ctx context.Context, actor *models.Actor, roleID string, permissionID string) error
- func (s *RolePermissionsService) ReplaceRolePermissions(ctx context.Context, actor *models.Actor, roleID string, ...) error
- type RolesService
- func (s *RolesService) CreateRole(ctx context.Context, actor *models.Actor, req types.CreateRoleRequest) (*types.Role, error)
- func (s *RolesService) DeleteRole(ctx context.Context, actor *models.Actor, roleID string) error
- func (s *RolesService) GetAllRoles(ctx context.Context, actor *models.Actor) ([]types.Role, error)
- func (s *RolesService) GetRoleByID(ctx context.Context, actor *models.Actor, roleID string) (*types.RoleDetails, error)
- func (s *RolesService) GetRoleByName(ctx context.Context, actor *models.Actor, roleName string) (*types.Role, error)
- func (s *RolesService) UpdateRole(ctx context.Context, actor *models.Actor, roleID string, ...) (*types.Role, error)
- type UserPermissionsService
- func (s *UserPermissionsService) GetSelfUserPermissions(ctx context.Context, actor *models.Actor, userID string) ([]types.UserPermissionInfo, error)
- func (s *UserPermissionsService) GetUserPermissions(ctx context.Context, actor *models.Actor, userID string) ([]types.UserPermissionInfo, error)
- func (s *UserPermissionsService) HasPermissions(ctx context.Context, actor *models.Actor, userID string, ...) (bool, error)
- type UserRolesService
- func (s *UserRolesService) AssignRoleToUser(ctx context.Context, actor *models.Actor, userID string, ...) error
- func (s *UserRolesService) GetUserRoles(ctx context.Context, actor *models.Actor, userID string) ([]types.UserRoleInfo, error)
- func (s *UserRolesService) RemoveRoleFromUser(ctx context.Context, actor *models.Actor, userID string, roleID string) error
- func (s *UserRolesService) ReplaceUserRoles(ctx context.Context, actor *models.Actor, userID string, roleIDs []string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlService ¶ added in v1.1.0
type AccessControlService struct {
// contains filtered or unexported fields
}
func NewAccessControlService ¶ added in v1.1.0
func NewAccessControlService(rolesService *RolesService, userRolesService *UserRolesService, permissionsRepo repositories.PermissionsRepository) *AccessControlService
func (*AccessControlService) EnsurePermissions ¶ added in v1.13.0
func (s *AccessControlService) EnsurePermissions(ctx context.Context, permissions []rootservices.PermissionDefinition) error
func (*AccessControlService) RoleExists ¶ added in v1.1.0
func (*AccessControlService) ValidatePermissionKeys ¶ added in v1.13.0
func (s *AccessControlService) ValidatePermissionKeys(ctx context.Context, permissionKeys []string) error
func (*AccessControlService) ValidateRoleAssignment ¶ added in v1.1.0
type PermissionsService ¶ added in v1.1.0
type PermissionsService struct {
// contains filtered or unexported fields
}
func NewPermissionsService ¶ added in v1.1.0
func NewPermissionsService(permissionsRepo repositories.PermissionsRepository, rolePermissionsRepo repositories.RolePermissionsRepository, authorizer rootservices.Authorizer) *PermissionsService
func (*PermissionsService) CreatePermission ¶ added in v1.1.0
func (s *PermissionsService) CreatePermission(ctx context.Context, actor *models.Actor, req types.CreatePermissionRequest) (*types.Permission, error)
func (*PermissionsService) DeletePermission ¶ added in v1.1.0
func (*PermissionsService) GetAllPermissions ¶ added in v1.1.0
func (s *PermissionsService) GetAllPermissions(ctx context.Context, actor *models.Actor) ([]types.Permission, error)
func (*PermissionsService) GetPermissionByID ¶ added in v1.1.0
func (s *PermissionsService) GetPermissionByID(ctx context.Context, actor *models.Actor, permissionID string) (*types.Permission, error)
func (*PermissionsService) GetPermissionByKey ¶ added in v1.1.0
func (s *PermissionsService) GetPermissionByKey(ctx context.Context, actor *models.Actor, permissionKey string) (*types.Permission, error)
func (*PermissionsService) UpdatePermission ¶ added in v1.1.0
func (s *PermissionsService) UpdatePermission(ctx context.Context, actor *models.Actor, permissionID string, req types.UpdatePermissionRequest) (*types.Permission, error)
type RolePermissionsService ¶ added in v1.1.0
type RolePermissionsService struct {
// contains filtered or unexported fields
}
func NewRolePermissionsService ¶ added in v1.1.0
func NewRolePermissionsService(rolesRepo repositories.RolesRepository, permissionsRepo repositories.PermissionsRepository, rolePermissionsRepo repositories.RolePermissionsRepository, authorizer rootservices.Authorizer) *RolePermissionsService
func (*RolePermissionsService) AddPermissionToRole ¶ added in v1.1.0
func (*RolePermissionsService) GetRolePermissions ¶ added in v1.1.0
func (s *RolePermissionsService) GetRolePermissions(ctx context.Context, actor *models.Actor, roleID string) ([]types.UserPermissionInfo, error)
func (*RolePermissionsService) RemovePermissionFromRole ¶ added in v1.1.0
type RolesService ¶ added in v1.1.0
type RolesService struct {
// contains filtered or unexported fields
}
func NewRolesService ¶ added in v1.1.0
func NewRolesService(rolesRepo repositories.RolesRepository, rolePermissionsRepo repositories.RolePermissionsRepository, userRolesRepo repositories.UserRolesRepository, authorizer rootservices.Authorizer) *RolesService
func (*RolesService) CreateRole ¶ added in v1.1.0
func (s *RolesService) CreateRole(ctx context.Context, actor *models.Actor, req types.CreateRoleRequest) (*types.Role, error)
func (*RolesService) DeleteRole ¶ added in v1.1.0
func (*RolesService) GetAllRoles ¶ added in v1.1.0
func (*RolesService) GetRoleByID ¶ added in v1.1.0
func (s *RolesService) GetRoleByID(ctx context.Context, actor *models.Actor, roleID string) (*types.RoleDetails, error)
func (*RolesService) GetRoleByName ¶ added in v1.1.0
func (*RolesService) UpdateRole ¶ added in v1.1.0
type UserPermissionsService ¶ added in v1.1.0
type UserPermissionsService struct {
// contains filtered or unexported fields
}
func NewUserPermissionsService ¶ added in v1.1.0
func NewUserPermissionsService(repo repositories.UserPermissionsRepository, authorizer rootservices.Authorizer) *UserPermissionsService
func (*UserPermissionsService) GetSelfUserPermissions ¶ added in v1.13.0
func (s *UserPermissionsService) GetSelfUserPermissions(ctx context.Context, actor *models.Actor, userID string) ([]types.UserPermissionInfo, error)
func (*UserPermissionsService) GetUserPermissions ¶ added in v1.1.0
func (s *UserPermissionsService) GetUserPermissions(ctx context.Context, actor *models.Actor, userID string) ([]types.UserPermissionInfo, error)
type UserRolesService ¶ added in v1.1.0
type UserRolesService struct {
// contains filtered or unexported fields
}
func NewUserRolesService ¶ added in v1.1.0
func NewUserRolesService(userRolesRepo repositories.UserRolesRepository, rolesRepo repositories.RolesRepository, authorizer rootservices.Authorizer) *UserRolesService
func (*UserRolesService) AssignRoleToUser ¶ added in v1.1.0
func (s *UserRolesService) AssignRoleToUser(ctx context.Context, actor *models.Actor, userID string, req types.AssignUserRoleRequest, assignedByUserID *string) error
func (*UserRolesService) GetUserRoles ¶ added in v1.1.0
func (s *UserRolesService) GetUserRoles(ctx context.Context, actor *models.Actor, userID string) ([]types.UserRoleInfo, error)
func (*UserRolesService) RemoveRoleFromUser ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.