catalogaclview

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: 6 Imported by: 0

Documentation

Overview

Package catalogaclview is a layer on top of catalog (same business model) which apply ACL rules before performing any action

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLViewCatalogAdapter

type ACLViewCatalogAdapter interface {
	FindAllAlbums(owner ownermodel.Owner) ([]*catalog.Album, error)
	FindAlbums(keys []catalog.AlbumId) ([]*catalog.Album, error)
	ListMedias(albumId catalog.AlbumId, request catalog.PageRequest) (*catalog.MediaPage, error)
}

type AlbumInView

type AlbumInView struct {
	*catalog.Album
	SharedWith    map[usermodel.UserId]aclcore.ScopeType // SharedWith is the list of emails to which this album is shared with the scope (Visitor or Contributor)
	DirectlyOwned bool                                   // DirectlyOwned is set to true when the user is an owner of the album
}

type ListAlbumsFilter

type ListAlbumsFilter struct {
	OnlyDirectlyOwned bool // OnlyDirectlyOwned provides a sub-view where only resources directly owned by user are displayed and accessible
}

type Sharing

type Sharing struct {
	MainUser   string // MainUser is the user having the "owner:main" grant
	Owner      string
	FolderName string
}

Sharing is caring.

type View

type View struct {
	UserEmail      string                  // UserEmail from which the catalog is seen
	CatalogRules   catalogacl.CatalogRules // CatalogRules is rules to use to authorise or deny accesses
	CatalogAdapter ACLViewCatalogAdapter   // CatalogAdapter is a proxy to the catalog domain
}

func (*View) ListAlbums

func (v *View) ListAlbums(filter ListAlbumsFilter) ([]*AlbumInView, error)

ListAlbums returns albums visible by the user (owned by current user, and shared to him)

func (*View) ListMediasFromAlbum

func (v *View) ListMediasFromAlbum(albumId catalog.AlbumId) (*catalog.MediaPage, error)

ListMediasFromAlbum returns medias contained on the album if user is allowed

Jump to

Keyboard shortcuts

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