catalogacl

package
v1.5.50 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 7 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() (*ownermodel.Owner, error)
	SharedWithUserAlbum() ([]catalog.AlbumId, error)
	SharedByUserGrid(owner ownermodel.Owner) (map[string]map[usermodel.UserId]aclcore.ScopeType, error)
	CanListMediasFromAlbum(id catalog.AlbumId) error
	CanReadMedia(owner ownermodel.Owner, id catalog.MediaId) error

	CanManageAlbum(id catalog.AlbumId) error
}

func NewCatalogRules

func NewCatalogRules(repository ScopeRepository, mediaAlbumResolver MediaAlbumResolver, email usermodel.UserId) 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 ownermodel.Owner, mediaId catalog.MediaId) (catalog.AlbumId, 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(albumId catalog.AlbumId, userEmail usermodel.UserId, scope aclcore.ScopeType) error

type ShareAlbumCatalogPort

type ShareAlbumCatalogPort interface {
	FindAlbum(albumId catalog.AlbumId) (*catalog.Album, error)
}

type UnShareAlbumCase

type UnShareAlbumCase struct {
	RevokeScopeRepository aclcore.ScopeWriter
}

func (*UnShareAlbumCase) StopSharingAlbum

func (u *UnShareAlbumCase) StopSharingAlbum(albumId catalog.AlbumId, email usermodel.UserId) error

Jump to

Keyboard shortcuts

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