permissions

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Memberships []members.Member `json:"memberships,omitempty"`
}

Permission describes a STACKIT permission

type PermissionList

type PermissionList struct {
	Permissions []Permission `json:"permissions,omitempty"`
}

PermissionList is a list of all permissions

type PermissionsService

type PermissionsService common.Service

PermissionsService is the service that handles CRUD functionality for permissions

func New

New returns a new handler for the service

func (*PermissionsService) GetByEmail

func (svc *PermissionsService) GetByEmail(ctx context.Context, email string, limit, offset int) (up UserPermissions, err error)

GetByEmail returns a list of resources and permissions assigned to a user by their email Reference: https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/get-user-permissions

func (*PermissionsService) List

func (svc *PermissionsService) List(ctx context.Context) (p PermissionList, err error)

List returns the a list of all available permissions Reference: https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/get-permissions

type ResourcePermissions

type ResourcePermissions struct {
	ResourceID   string       `json:"resourceId,omitempty"`
	ResourceType string       `json:"resourceType,omitempty"`
	Permissions  []Permission `json:"permissions,omitempty"`
}

ResourcePermissions describes the resource and permissions assigned

type UserPermissions

type UserPermissions struct {
	Items  []ResourcePermissions `json:"items,omitempty"`
	Limit  int                   `json:"limit,omitempty"`
	Offset int                   `json:"offset,omitempty"`
}

UserPermissions is a struct listing user permissions for every resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL