permissions

package
v2.26.7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEditor

func IsEditor(rp *provider.ResourcePermissions) bool

IsEditor returns true if the given resource permissions evaluate the user as "editor"

func IsManager

func IsManager(rp *provider.ResourcePermissions) bool

IsManager returns true if the given resource permissions evaluate the user as "manager"

func IsViewer

func IsViewer(rp *provider.ResourcePermissions) bool

IsViewer returns true if the given resource permissions evaluate the user as "viewer"

Types

type CS3PermissionsClient

type CS3PermissionsClient interface {
	CheckPermission(ctx context.Context, in *cs3permissions.CheckPermissionRequest, opts ...grpc.CallOption) (*cs3permissions.CheckPermissionResponse, error)
}

CS3PermissionsClient defines an interface for checking permissions against the CS3 permissions service

type Permissions

type Permissions struct {
	// contains filtered or unexported fields
}

Permissions manages permissions

func NewPermissions

func NewPermissions(item PermissionsChecker, permissionsSelector pool.Selectable[cs3permissions.PermissionsAPIClient]) Permissions

NewPermissions returns a new Permissions instance

func (Permissions) AssemblePermissions

func (p Permissions) AssemblePermissions(ctx context.Context, n *node.Node) (*provider.ResourcePermissions, error)

AssemblePermissions is used to assemble file permissions

func (Permissions) AssembleTrashPermissions

func (p Permissions) AssembleTrashPermissions(ctx context.Context, n *node.Node) (*provider.ResourcePermissions, error)

AssembleTrashPermissions is used to assemble file permissions

func (Permissions) CreateSpace

func (p Permissions) CreateSpace(ctx context.Context, spaceid string) bool

CreateSpace returns true when the user is allowed to create the space

func (Permissions) DeleteAllHomeSpaces

func (p Permissions) DeleteAllHomeSpaces(ctx context.Context) bool

DeleteAllHomeSpaces returns true when the user is allowed to delete all home spaces

func (Permissions) DeleteAllSpaces

func (p Permissions) DeleteAllSpaces(ctx context.Context) bool

DeleteAllSpaces returns true when the user is allowed to delete all spaces

func (Permissions) ListAllSpaces

func (p Permissions) ListAllSpaces(ctx context.Context) bool

ListAllSpaces returns true when the user is allowed to list all spaces

func (Permissions) ListSpacesOfUser

func (p Permissions) ListSpacesOfUser(ctx context.Context, userid *userv1beta1.UserId) bool

ListSpacesOfUser returns true when the user is allowed to list the spaces of the given user

func (Permissions) ManageSpaceProperties

func (p Permissions) ManageSpaceProperties(ctx context.Context, spaceid string) bool

ManageSpaceProperties returns true when the user is allowed to change space properties (name/subtitle)

func (Permissions) SetSpaceQuota

func (p Permissions) SetSpaceQuota(ctx context.Context, spaceid string, spaceType string) bool

SetSpaceQuota returns true when the user is allowed to change the spaces quota

func (Permissions) SpaceAbility

func (p Permissions) SpaceAbility(ctx context.Context, spaceid string) bool

SpaceAbility returns true when the user is allowed to enable/disable the space

type PermissionsChecker

type PermissionsChecker interface {
	AssemblePermissions(ctx context.Context, n *node.Node) (ap *provider.ResourcePermissions, err error)
	AssembleTrashPermissions(ctx context.Context, n *node.Node) (ap *provider.ResourcePermissions, err error)
}

PermissionsChecker defines an interface for checking permissions on a Node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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