catalogacl

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Overview

Package catalogacl contains the logic to authorise access to catalog resources based on user requesting it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogRules

type CatalogRules interface {
	Owner() (string, error)
	SharedWithUserAlbum() ([]catalog.AlbumId, error)
	SharedByUserGrid(owner string) (map[string]map[string]aclcore.ScopeType, error)
	CanListMediasFromAlbum(owner string, folderName string) error
	CanReadMedia(owner string, id string) error

	CanManageAlbum(owner string, folderName string) error
}

func NewCatalogRules

func NewCatalogRules(repository ScopeRepository, mediaAlbumResolver MediaAlbumResolver, email string) CatalogRules

NewCatalogRules creates an adapter catalogacl -> aclcore which will always request DB layer

func OptimiseRulesWithAccessToken

func OptimiseRulesWithAccessToken(delegate CatalogRules, claims aclcore.Claims) CatalogRules

OptimiseRulesWithAccessToken creates an adapter catalogacl -> aclcore with pre-authorised scopes from the Access Token

type MediaAlbumResolver

type MediaAlbumResolver interface {
	FindAlbumOfMedia(owner, mediaId string) (string, error)
}

type ScopeRepository

type ScopeRepository interface {
	aclcore.ScopesReader
	aclcore.ReverseScopesReader
}

type ShareAlbumCase

type ShareAlbumCase struct {
	ScopeWriter aclcore.ScopeWriter
	CatalogPort ShareAlbumCatalogPort
}

func (*ShareAlbumCase) ShareAlbumWith

func (s *ShareAlbumCase) ShareAlbumWith(owner, folderName, userEmail string, scope aclcore.ScopeType) error

type ShareAlbumCatalogPort

type ShareAlbumCatalogPort interface {
	FindAlbum(owner, folderName string) (*catalog.Album, error)
}

type UnShareAlbumCase

type UnShareAlbumCase struct {
	RevokeScopeRepository aclcore.ScopeWriter
}

func (*UnShareAlbumCase) StopSharingAlbum

func (u *UnShareAlbumCase) StopSharingAlbum(owner, folderName, email string) error

Jump to

Keyboard shortcuts

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