Documentation ¶
Overview ¶
Package role implements the service layer functionality related to Tharsis roles. Roles allow a Tharsis subject to access resources offered by the API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRoleInput ¶
type CreateRoleInput struct { Name string Description string Permissions []permissions.Permission }
CreateRoleInput is the input for creating a Role.
type DeleteRoleInput ¶
DeleteRoleInput is the input for deleting a Role.
type GetRolesInput ¶
type GetRolesInput struct { // Sort specifies the field to sort on and direction Sort *db.RoleSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // Search filters role list by roleName prefix Search *string }
GetRolesInput is the input for querying a list of roles.
type Service ¶
type Service interface { GetAvailablePermissions(ctx context.Context) ([]string, error) GetRoleByID(ctx context.Context, id string) (*models.Role, error) GetRoleByName(ctx context.Context, name string) (*models.Role, error) GetRolesByIDs(ctx context.Context, idList []string) ([]models.Role, error) GetRoles(ctx context.Context, input *GetRolesInput) (*db.RolesResult, error) CreateRole(ctx context.Context, input *CreateRoleInput) (*models.Role, error) UpdateRole(ctx context.Context, input *UpdateRoleInput) (*models.Role, error) DeleteRole(ctx context.Context, input *DeleteRoleInput) error }
Service implements all the functionality related to Roles.
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, activityService activityevent.Service, ) Service
NewService creates an instance of Service
type UpdateRoleInput ¶
UpdateRoleInput is the input for updating a Role.
Click to show internal directories.
Click to hide internal directories.