Documentation ¶
Index ¶
- Constants
- func GroupFiltersByType(filters []*collaboration.Filter) map[collaboration.Filter_Type][]*collaboration.Filter
- func GroupGranteeFilter() *collaboration.Filter
- func IsCreatedByUser(share *collaboration.Share, user *userv1beta1.User) bool
- func IsGrantedToUser(share *collaboration.Share, user *userv1beta1.User) bool
- func MatchesAnyFilter(share *collaboration.Share, filters []*collaboration.Filter) bool
- func MatchesFilter(share *collaboration.Share, filter *collaboration.Filter) bool
- func MatchesFilters(share *collaboration.Share, filters []*collaboration.Filter) bool
- func ResourceIDFilter(id *provider.ResourceId) *collaboration.Filter
- func StorageIDFilter(id string) *collaboration.Filter
- func UserGranteeFilter() *collaboration.Filter
- type Manager
- type Metadata
Constants ¶
const ( // StorageIDFilterType defines a new filter type for storage id. // TODO: Remove once this filter type is in the CS3 API. StorageIDFilterType collaboration.Filter_Type = 7 )
Variables ¶
This section is empty.
Functions ¶
func GroupFiltersByType ¶
func GroupFiltersByType(filters []*collaboration.Filter) map[collaboration.Filter_Type][]*collaboration.Filter
GroupFiltersByType groups the given filters and returns a map using the filter type as the key.
func GroupGranteeFilter ¶
func GroupGranteeFilter() *collaboration.Filter
GroupGranteeFilter is an abstraction for creating filter by grantee type group.
func IsCreatedByUser ¶
func IsCreatedByUser(share *collaboration.Share, user *userv1beta1.User) bool
IsCreatedByUser checks if the user is the owner or creator of the share.
func IsGrantedToUser ¶
func IsGrantedToUser(share *collaboration.Share, user *userv1beta1.User) bool
IsGrantedToUser checks if the user is a grantee of the share. Either by a user grant or by a group grant.
func MatchesAnyFilter ¶
func MatchesAnyFilter(share *collaboration.Share, filters []*collaboration.Filter) bool
MatchesAnyFilter checks if the share passes at least one of the given filters.
func MatchesFilter ¶
func MatchesFilter(share *collaboration.Share, filter *collaboration.Filter) bool
MatchesFilter tests if the share passes the filter.
func MatchesFilters ¶
func MatchesFilters(share *collaboration.Share, filters []*collaboration.Filter) bool
MatchesFilters checks if the share passes the given filters. Filters of the same type form a disjuntion, a logical OR. Filters of separate type form a conjunction, a logical AND. Here is an example: (resource_id=1 OR resource_id=2) AND (grantee_type=USER OR grantee_type=GROUP)
func ResourceIDFilter ¶
func ResourceIDFilter(id *provider.ResourceId) *collaboration.Filter
ResourceIDFilter is an abstraction for creating filter by resource id.
func StorageIDFilter ¶
func StorageIDFilter(id string) *collaboration.Filter
StorageIDFilter is an abstraction for creating filter by storage id.
func UserGranteeFilter ¶
func UserGranteeFilter() *collaboration.Filter
UserGranteeFilter is an abstraction for creating filter by grantee type user.
Types ¶
type Manager ¶
type Manager interface { context.Context, md *provider.ResourceInfo, g *collaboration.ShareGrant) (*collaboration.Share, error) GetShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.Share, error) Unshare(ctx context.Context, ref *collaboration.ShareReference) error UpdateShare(ctx context.Context, ref *collaboration.ShareReference, p *collaboration.SharePermissions) (*collaboration.Share, error) // it returns only shares attached to the given resource. ListShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.Share, error) ListReceivedShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error) GetReceivedShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.ReceivedShare, error) UpdateReceivedShare(ctx context.Context, share *collaboration.ReceivedShare, fieldMask *field_mask.FieldMask) (*collaboration.ReceivedShare, error) }Share(ctx
Manager is the interface that manipulates shares.