Documentation ¶
Overview ¶
package roles is used for creating and managing custom roles (and permissions assigned to them)
Index ¶
- type Role
- type Roles
- type RolesService
- func (svc *RolesService) AddCustom(ctx context.Context, resourceID, resourceType string, roles ...Role) (res Roles, err error)
- func (svc *RolesService) GetByResource(ctx context.Context, resourceID, resourceType string) (r Roles, err error)
- func (svc *RolesService) RemoveCustom(ctx context.Context, resourceID, resourceType string, roles ...Role) (r Roles, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Role ¶
type Role struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Permissions []permissions.Permission `json:"permissions,omitempty"` }
Role is a STACKIT role (or a custom user role)
type Roles ¶
type Roles struct { ResourceID string `json:"resourceId,omitempty"` ResourceType string `json:"resourceType,omitempty"` Roles []Role `json:"roles,omitempty"` }
Roles describes the resource and roles assigned to it
type RolesService ¶
RolesService is the service that handles CRUD functionality for membership roles
func (*RolesService) AddCustom ¶
func (svc *RolesService) AddCustom(ctx context.Context, resourceID, resourceType string, roles ...Role) (res Roles, err error)
AddCustom adds new user specified roles to a resource https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/patch-roles
func (*RolesService) GetByResource ¶
func (svc *RolesService) GetByResource(ctx context.Context, resourceID, resourceType string) (r Roles, err error)
GetByResource returns a list of roles and permissions by resources type & ID Reference: https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/get-roles
func (*RolesService) RemoveCustom ¶
func (svc *RolesService) RemoveCustom(ctx context.Context, resourceID, resourceType string, roles ...Role) (r Roles, err error)
RemoveCustom removes custom user specified roles from a resource Reference: https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/post-roles-remove