catalogacl

package
v1.6.39 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessDenied = errors.New("access denied")
)

Functions

This section is empty.

Types

type AlbumSharedObserver added in v1.6.4

type AlbumSharedObserver interface {
	AlbumShared(ctx context.Context, albumId catalog.AlbumId, userEmail usermodel.UserId) error
}

type AlbumUnSharedObserver added in v1.6.4

type AlbumUnSharedObserver interface {
	AlbumUnShared(ctx context.Context, albumId catalog.AlbumId, userEmail usermodel.UserId) error
}

type CatalogAuthorizer added in v1.6.5

type CatalogAuthorizer struct {
	HasPermissionPort  HasPermissionPort
	CatalogQueriesPort CatalogQueriesPort
}

func (*CatalogAuthorizer) CanShareAlbum added in v1.6.5

func (a *CatalogAuthorizer) CanShareAlbum(ctx context.Context, user usermodel.CurrentUser, albumId catalog.AlbumId) error

func (*CatalogAuthorizer) IsAuthorisedToListMedias added in v1.6.5

func (a *CatalogAuthorizer) IsAuthorisedToListMedias(ctx context.Context, userId usermodel.CurrentUser, albumId catalog.AlbumId) error

func (*CatalogAuthorizer) IsAuthorisedToViewMedia added in v1.6.5

func (a *CatalogAuthorizer) IsAuthorisedToViewMedia(ctx context.Context, currentUser usermodel.CurrentUser, owner ownermodel.Owner, mediaId catalog.MediaId) error

type CatalogQueriesPort added in v1.6.5

type CatalogQueriesPort interface {
	FindMediaOwnership(ctx context.Context, owner ownermodel.Owner, mediaId catalog.MediaId) (*catalog.AlbumId, error)
}

type FindAlbumPort added in v1.6.4

type FindAlbumPort interface {
	FindAlbum(ctx context.Context, albumId catalog.AlbumId) (*catalog.Album, error)
}

type HasPermissionPort added in v1.6.5

type HasPermissionPort interface {
	FindScopesByIdCtx(ctx context.Context, ids ...aclcore.ScopeId) ([]*aclcore.Scope, error)
}

type ReverseReader added in v1.6.5

type ReverseReader struct {
	ScopeRepository ScopeReadRepositoryPort
}

ReverseReader reads the permissions to read what can be accessed by who, and who can access what

func (*ReverseReader) GetAlbumSharingGrid added in v1.6.5

func (f *ReverseReader) GetAlbumSharingGrid(ctx context.Context, owner ownermodel.Owner) (map[catalog.AlbumId][]usermodel.UserId, error)

func (*ReverseReader) ListAlbumIdsSharedWithUser added in v1.6.5

func (f *ReverseReader) ListAlbumIdsSharedWithUser(ctx context.Context, userId usermodel.UserId) ([]catalog.AlbumId, error)

func (*ReverseReader) ListUsersWhoCanAccessAlbum added in v1.6.5

func (f *ReverseReader) ListUsersWhoCanAccessAlbum(ctx context.Context, albumIds ...catalog.AlbumId) (map[catalog.AlbumId][]catalogviews.Availability, error)

type ScopeReadRepositoryPort added in v1.6.5

type ScopeReadRepositoryPort interface {
	ListScopesByOwner(ctx context.Context, owner ownermodel.Owner, types ...aclcore.ScopeType) ([]*aclcore.Scope, error)
	ListScopesByUser(ctx context.Context, id usermodel.UserId, types ...aclcore.ScopeType) ([]*aclcore.Scope, error)
}

type ShareAlbumCase

type ShareAlbumCase struct {
	ScopeWriter   aclcore.ScopeWriter
	FindAlbumPort FindAlbumPort
	Observers     []AlbumSharedObserver
}

func (*ShareAlbumCase) ShareAlbumWith

func (s *ShareAlbumCase) ShareAlbumWith(albumId catalog.AlbumId, userEmail usermodel.UserId, scope aclcore.ScopeType) error

type UnShareAlbumCase

type UnShareAlbumCase struct {
	RevokeScopeRepository aclcore.ScopeWriter
	Observers             []AlbumUnSharedObserver
}

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