catalogviewstoacl

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type CatalogAuthorizer added in v1.6.4

type CatalogAuthorizer struct {
	HasPermissionPort  HasPermissionPort
	CatalogQueriesPort CatalogQueriesPort
}

func (*CatalogAuthorizer) CanShareAlbum added in v1.6.4

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

func (*CatalogAuthorizer) IsAuthorisedToListMedias added in v1.6.4

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

func (*CatalogAuthorizer) IsAuthorisedToViewMedia added in v1.6.4

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

type CatalogQueriesPort added in v1.6.4

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

type CatalogToACLAdapter added in v1.6.4

type CatalogToACLAdapter struct {
	ScopeRepository ScopeReadRepositoryPort
}

func (*CatalogToACLAdapter) GetAlbumSharingGrid added in v1.6.4

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

func (*CatalogToACLAdapter) ListAlbumIdsSharedWithUser added in v1.6.4

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

func (*CatalogToACLAdapter) ListUsersWhoCanAccessAlbum added in v1.6.4

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

type HasPermissionPort added in v1.6.4

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

type ScopeReadRepositoryPort

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)
}

Jump to

Keyboard shortcuts

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