Folders – system description

Tables of storage and share folders, rules for creating and editing, Drive permission endpoints, deletion and the permission keys of share folders.

Unified folder module: storage folders (registration of a physical folder) and share folders (virtual) in one merged list with document counts. Share folders have no controller of their own; this module checks their permission keys.

Data model

Table names carry the installation's own prefix in the database.

TableRole
folderstorage folder registration
doc_share, doc_share_itemshare folder and its documents
doc_share_user, doc_share_to_storeassigned users, websites
doccounts, folders derived from documents

Process

  1. List: registered and document-derived storage folders plus share folders; scope (getAllowedCompanyIds); row buttons tied to documentshare edit/delete, document list/edit/share, folders download.
  2. Creation – shared: name required and unique, addShare (active/inactive, parent, websites), user sync; storage: client required (scope), for gdrive the company's linked account and a parent folder are required, for local an existing directory under the storage root; a second registration is refused (error_folder_exists); optional virtual share and users. Without the table: error_folder_table.
  3. Editing: editinfo, editfolder (on Drive renameFile/moveFile, locally directory rename; same name refused), setstatus, shareitemadd/shareitemdel (link only), docsearch (scope-filtered, max. 10), permissions/addpermission (e-mail validation, role reader/commenter/writer)/delpermission, locallist/createlocalfolder (edit or the calling screen's right).
  4. Delete (folder:<id> / shared:<id>): storage registration only when empty (error_folder_in_use), the physical folder stays; share folder: deleteShare, documents stay.

Permissions

  • Function rights: folders list, add (canSave), edit, delete, debug; for share folders documentshare edit (sharestatus with documentshare OR folders edit) and delete.
  • documentshare list and debug exist only in the catalogue.

Known limitations

The Drive permission endpoints, setstatus and shareitemadd/shareitemdel do not check the folder's company against the scope.

Related topics: folders sharing permissions