Documentation ¶
Index ¶
- Constants
- func AclsToCellAcls(ctx context.Context, acls []*idm.ACL) map[string]*rest.CellAcl
- func CheckCellOptionsAgainstConfigs(ctx context.Context, request *rest.PutCellRequest) error
- func CheckLinkRootNodes(ctx context.Context, link *rest.ShareLink) (workspaces []*tree.WorkspaceRelativePath, files, folders bool, e error)
- func ClearLostHiddenUsers(ctx context.Context) error
- func CommonAclsForWorkspace(ctx context.Context, workspaceId string) (result []*idm.ACL, detectedRoots []string, err error)
- func ComputeTargetAcls(ctx context.Context, ownerUser *idm.User, cell *rest.Cell, workspaceId string, ...) []*idm.ACL
- func DeleteHashDocument(ctx context.Context, shareId string) error
- func DeleteHiddenUser(ctx context.Context, link *rest.ShareLink) error
- func DeleteRootNodeRecursively(ctx context.Context, ownerName string, roomNode *tree.Node) error
- func DeleteWorkspace(ctx context.Context, ownerUser *idm.User, scope idm.WorkspaceScope, ...) error
- func DiffAcls(ctx context.Context, initial []*idm.ACL, newOnes []*idm.ACL) (add []*idm.ACL, remove []*idm.ACL)
- func DiffReadRoles(ctx context.Context, initial []*idm.ACL, newOnes []*idm.ACL) (add []string, remove []string)
- func GetOrCreateHiddenUser(ctx context.Context, ownerUser *idm.User, link *rest.ShareLink, ...) (user *idm.User, err error)
- func GetOrCreateWorkspace(ctx context.Context, ownerUser *idm.User, wsUuid string, ...) (*idm.Workspace, bool, error)
- func GetTemplateACLsForMinisite(ctx context.Context, roleId string, perms []rest.ShareLinkAccessType, ...) (acls []*idm.ACL, err error)
- func LoadCellAclsObjects(ctx context.Context, roomAcls map[string]*rest.CellAcl, ...) error
- func LoadDetectedRootNodes(ctx context.Context, detectedRoots []string) (rootNodes map[string]*tree.Node)
- func LoadHashDocumentData(ctx context.Context, shareLink *rest.ShareLink, acls []*idm.ACL) error
- func OwnerResourcePolicies(ctx context.Context, ownerUser *idm.User, resourceId string) []*service.ResourcePolicy
- func ParseRootNodes(ctx context.Context, shareRequest *rest.PutCellRequest) (error, *tree.Node, bool)
- func SearchHashDocumentForUser(ctx context.Context, userLogin string) (*docstore.ShareDocument, error)
- func StoreHashDocument(ctx context.Context, ownerUser *idm.User, link *rest.ShareLink, ...) error
- func UpdateACLsForHiddenUser(ctx context.Context, roleId string, workspaceId string, rootNodes []*tree.Node, ...) error
- func UpdatePoliciesFromAcls(ctx context.Context, workspace *idm.Workspace, initial []*idm.ACL, ...) bool
- func WorkspaceToCellObject(ctx context.Context, workspace *idm.Workspace, checker ContextEditableChecker) (*rest.Cell, error)
- func WorkspaceToShareLinkObject(ctx context.Context, workspace *idm.Workspace, checker ContextEditableChecker) (*rest.ShareLink, error)
- type ContextEditableChecker
- type PluginOptions
Constants ¶
const PasswordComplexitySuffix = "#$!Az1"
Variables ¶
This section is empty.
Functions ¶
func AclsToCellAcls ¶
AclsToCellAcls Rewrites a flat list of ACLs to a structured map of CellAcls (more easily usable by clients).
func CheckCellOptionsAgainstConfigs ¶
func CheckCellOptionsAgainstConfigs(ctx context.Context, request *rest.PutCellRequest) error
func CheckLinkRootNodes ¶
func CheckLinkRootNodes(ctx context.Context, link *rest.ShareLink) (workspaces []*tree.WorkspaceRelativePath, files, folders bool, e error)
CheckLinkRootNodes loads the root nodes and check if one of the is readonly. If so, check that link permissions do not try to set the Upload mode.
func ClearLostHiddenUsers ¶
ClearLostHiddenUsers makes sure that hidden users that are not linked to any existing link are removed. This is used during a migration to fix the missing users deletion prior to v2.0.0
func CommonAclsForWorkspace ¶
func CommonAclsForWorkspace(ctx context.Context, workspaceId string) (result []*idm.ACL, detectedRoots []string, err error)
CommonAclsForWorkspace makes successive calls to ACL service to get all ACLs for a given workspace.
func ComputeTargetAcls ¶
func ComputeTargetAcls(ctx context.Context, ownerUser *idm.User, cell *rest.Cell, workspaceId string, readonly bool) []*idm.ACL
ComputeTargetAcls create ACL objects that should be applied for this cell.
func DeleteHiddenUser ¶
DeleteHiddenUser removes hidden user associated with this link
func DeleteRootNodeRecursively ¶
DeleteRootNodeRecursively loads all children of a root node and delete them, including the .pydio hidden files when they are folders.
func DeleteWorkspace ¶
func DeleteWorkspace(ctx context.Context, ownerUser *idm.User, scope idm.WorkspaceScope, workspaceId string, checker ContextEditableChecker) error
DeleteWorkspace deletes a workspace and associated policies and ACLs. It also deletes the room node if necessary.
func DiffAcls ¶
func DiffAcls(ctx context.Context, initial []*idm.ACL, newOnes []*idm.ACL) (add []*idm.ACL, remove []*idm.ACL)
DiffAcls compares to slices of ACLs on their RoleID and Action and returns slices of Acls to add and to remove.
func DiffReadRoles ¶
func DiffReadRoles(ctx context.Context, initial []*idm.ACL, newOnes []*idm.ACL) (add []string, remove []string)
DiffReadRoles detects the roles that have been globally added or removed, whatever the node.
func GetOrCreateHiddenUser ¶
func GetOrCreateHiddenUser(ctx context.Context, ownerUser *idm.User, link *rest.ShareLink, passwordEnabled bool, updatePassword string, passwordHashed bool) (user *idm.User, err error)
GetOrCreateHiddenUser will load or create a user to create a ShareLink with.
func GetOrCreateWorkspace ¶
func GetOrCreateWorkspace(ctx context.Context, ownerUser *idm.User, wsUuid string, scope idm.WorkspaceScope, label string, description string, updateIfNeeded bool) (*idm.Workspace, bool, error)
GetOrCreateWorkspace finds a workspace by its Uuid or creates it with the current user ResourcePolicies if it does not already exist.
func GetTemplateACLsForMinisite ¶
func GetTemplateACLsForMinisite(ctx context.Context, roleId string, perms []rest.ShareLinkAccessType, aclClient idm.ACLServiceClient) (acls []*idm.ACL, err error)
GetTemplateACLsForMinisite loads actions and parameter acls from specific template roles.
func LoadCellAclsObjects ¶
func LoadCellAclsObjects(ctx context.Context, roomAcls map[string]*rest.CellAcl, checker ContextEditableChecker) error
LoadCellAclsObjects loads associated users / groups / roles based on the role Ids of the acls.
func LoadDetectedRootNodes ¶
func LoadDetectedRootNodes(ctx context.Context, detectedRoots []string) (rootNodes map[string]*tree.Node)
LoadDetectedRootNodes find actual nodes in the tree, and enrich their metadata if they appear in many workspaces for the current user.
func LoadHashDocumentData ¶
func OwnerResourcePolicies ¶
func OwnerResourcePolicies(ctx context.Context, ownerUser *idm.User, resourceId string) []*service.ResourcePolicy
OwnerResourcePolicies produces a set of policies given ownership to current context user, read/write to current context user, and write access to profile:admin (can be useful for admin).
func ParseRootNodes ¶
func ParseRootNodes(ctx context.Context, shareRequest *rest.PutCellRequest) (error, *tree.Node, bool)
ParseRootNodes reads the request property to either create a new node using the "rooms" Virtual node, or just verify that the root nodes are not empty.
func SearchHashDocumentForUser ¶
func SearchHashDocumentForUser(ctx context.Context, userLogin string) (*docstore.ShareDocument, error)
SearchHashDocumentForUser searches the DocStore to find documents that have either PRELOG_USER or PRESET_LOGIN with the passed userLogin value.
func StoreHashDocument ¶
func UpdateACLsForHiddenUser ¶
func UpdateACLsForHiddenUser(ctx context.Context, roleId string, workspaceId string, rootNodes []*tree.Node, permissions []rest.ShareLinkAccessType, update bool) error
UpdateACLsForHiddenUser deletes and replaces access ACLs for a hidden user.
func UpdatePoliciesFromAcls ¶
func UpdatePoliciesFromAcls(ctx context.Context, workspace *idm.Workspace, initial []*idm.ACL, target []*idm.ACL) bool
UpdatePoliciesFromAcls recomputes the required policies from acl changes.
func WorkspaceToCellObject ¶
func WorkspaceToCellObject(ctx context.Context, workspace *idm.Workspace, checker ContextEditableChecker) (*rest.Cell, error)
WorkspaceToCellObject rewrites a workspace to a Cell object by reloading its ACLs.
Types ¶
type ContextEditableChecker ¶
type PluginOptions ¶
type PluginOptions struct { MaxExpiration int MaxDownloads int HashMinLength int HashEditable bool // contains filtered or unexported fields }
func CheckLinkOptionsAgainstConfigs ¶
func CheckLinkOptionsAgainstConfigs(ctx context.Context, link *rest.ShareLink, wss []*tree.WorkspaceRelativePath, files, folders bool) (PluginOptions, error)