Skip to content

Permissions and Portal Visibility ​

Overview ​

Access in the Backend-API is decided in four layers:

  1. Who the caller is. Each API has its own Passport guard and user model (admin User, partner DealerUsers, integration DamExternalApp, external upload ExternalUser); see Authentication.
  2. Workspace and DAM role (admin users). checkUserWithWS requires membership of the workspace in url_workspace_id. Most DAM endpoints then call DamInstance::checkUser(), which requires the DAM module to be active for the workspace and the user's DAM role to be Admin, Manager or Viewer.
  3. Portal visibility (partners). Each asset, folder and collage has zero or one DamInstancePermission row per portal. The Portal API only returns items whose row says public (or protected, for folders).
  4. ACL roles (external integrations). Assets carry a CSV of DamAcl ids in acl_permission; External API calls name a role and only see assets tagged with it.

Plan limits (checkFeatureRestriction) sit on top of all of this and are covered in Subscription.

Portal visibility values ​

The table dam_instance_permissions (model DamInstancePermission, unique on dam_instance_id + permissionable_id + permissionable_type) stores one row per item and portal. permissionable_type is DigitalAssets, DigitalAssetsCategory or DamCollection. The column comment in the migration reads 0=Public, 1=Private, 2=Protected.

visibilityAssetFolderCollage
0 publicShown in the portalShown, contents filteredShown
1 privateHiddenHiddenHidden
2 protectednot usedShown as a navigable path because something beneath it is public; not published itselfnot used
no rowHidden (private)Hidden (private)Hidden (private)

The names suggest the opposite of how many people read them: 0 is the open value. Before multi-portal support the same values lived in a visibility column on each table; migration 2026_03_23_120000_migrate_visibility_to_dam_instance_permissions copied rows with 0 or 2 to the workspace's single portal and dropped private ones, which is why "no row" means private. The legacy columns still exist and are still written in places (folder create and restore), but portal reads use only the permission rows.

Endpoints ​

Roles and ACL (Admin API, /api/v1) ​

MethodPathController@methodPurpose
GET/user/role-moduleUsersController@userModuleAndRoleCurrent user's modules and roles
GET/user/roles-permissionsUsersController@getRolesPermissionsRole list for the users screen
POST/user/user-change-passwordUsersController@userChangePasswordSet another user's password, DAM Admin only
GET POST/sso/*SsoSettingsControllerWorkspace owner only (checkWorkspaceOwner, checkSsoAllowed)
GET/digital-assets/acl/listACLController@getACL roles by position (optionally active only)
POST/digital-assets/acl/createACLController@createCreate a role (name unique per workspace)
PATCH/digital-assets/acl/update, /acl/update-orderACLController@update, @updateOrderRename, toggle, reorder
DELETE/digital-assets/acl/deleteACLController@deleteDelete roles by id[]
POST/digital-assets/update-with-fieldAssetController@updateAssetsWithFieldfield_name = acl_permission sets one asset's roles
POST/digital-assets/update-aclAssetController@updateMultipleACLAdd or remove role ids on many assets

Portal visibility (Admin API, /api/v1/digital-assets) ​

MethodPathController@methodPurpose
POST/permission/change-permissionDamPermissionController@changePermissionSet assets, folders and collages public or private per portal
POST/permission/bulk-instance-visibilityDamPermissionController@bulkInstanceVisibilityWhich of the given assets and folders are public in each portal
POST/instance/change-portal-visibilityDamInstanceController@changePortalVisibilityMake a whole portal public (anonymous sign-in) or private
POST/instance/updateDamInstanceController@updateis_active turns a portal off
POST/instance/create-user, /instance/delete-restore-userDamInstanceControllerGrant or revoke a partner's access to portals

Moves, uploads, copies, trash and restore also write permission rows; see Assets and Folders.

Workflows ​

Admin DAM access check ​

The first three steps are middleware (auth:api, checkUserWithWS); the last two are DamInstance::checkUser(), called inside each controller. Roles come from role_user (workspace_id, module_id, role_id) joined to roles; modules are 1 (projects), 2 (DAM) and 3 (leads). Creating a workspace with the DAM module creates Admin (hierarchy 1), Manager (2) and Viewer (3) and makes the creator Admin. Apart from checkUser, the backend rarely tells the three roles apart: user/user-change-password requires Admin, system notification emails go to DAM Admin users, and seat counts split admin and frontend users. Finer role rules (what a Viewer may click) are enforced in the admin app. SSO endpoints check workspace ownership (workspaces.user_id) instead of a role.

Endpoints in this guide that skip checkUser even though they change or read workspace data: category/rename/{id}, category/view-files-with-category, category/get-count/{id}, permission/change-permission, permission/bulk-instance-visibility, instance/update-settings, instance/change-portal-visibility, announcement/add. The last two instance endpoints also look the portal up by instance_id alone, without checking that it belongs to the workspace, and change-permission validates instance_ids only with exists:dam_instances,id.

Can partner X see asset Y in portal Z? ​

The first three checks are DAMAPIMiddleware; the portal comes from instance_id, the X-Instance-Id header or the partner's stored instance_id. If none of those is set, the middleware lets the request through without a portal check. The last two checks are the instanceVisible($instanceId) scope plus the live-asset filter in each portal query (view-detail, view-files-with-category, search-assets, common-search, collage assets, counts). The asset's folder is not checked again: an asset that is public in Z is returned even if its folder row is private. Backend users created by login-with-id (admin "view as portal") skip the access row check but not the visibility filter.

Can partner X see folder F or collage C? ​

DigitalAssetsCategory::scopeInstanceVisible accepts 0 and 2; DamCollection::scopeInstanceVisible and DigitalAssets::scopeInstanceVisible accept only 0. A protected folder therefore appears in the tree, but only its public sub folders and assets are listed.

Publish or unpublish (change-permission) ​

Rules inside the transaction:

  • Only live assets and existing folders and collages get new rows; rows are removed for every requested id.
  • Folder made private (visibility = 1, no nested_apply) while public content remains beneath it: written as 2 when that content is in a sub folder, else 1.
  • A folder's direct assets always follow the folder's requested value. With nested_apply = 1 the whole live subtree (folders and assets) gets the same value.
  • Portals left out of instance_ids lose their rows for the items. An empty instance_ids makes the items private everywhere. A de-selected folder is written back as 2 there when a sub folder still holds public content (not with nested_apply).
  • Explicit removal wins: a requested folder keeps no row on a de-selected portal even if it was re-evaluated as a parent.

Reindexing is inline for up to 2000 assets (SYNC_REINDEX_LIMIT), otherwise through ReindexAssetsByIds; a failed inline push falls back to the queue. A collage permission change reindexes only the collage document.

Folder recalculation (FolderVisibilityRecalculator) ​

"Public" means an asset row with 0 or a sub folder row with 0; "private" means an asset with row 1 or no row, or a sub folder with row 1, 2 or no row. A folder never looks at its own row when judging content. Folders are evaluated once per portal, deepest first, so a parent sees its children's final rows. Mixed content leaves a 0 folder at 0. The service is used by change-permission, asset and folder move, folder trash and archive. Restore does not call it; syncInstancePermissionsFromParent() copies the parent folder's rows onto the restored folder and its assets (0 stays 0, anything else becomes 1), and restored assets in a live folder take that folder's rows the same way (see Folders). It loads the workspace tree (id, parent_id) once and answers subtree questions with EXISTS queries.

Inheritance on create, upload, move and copy ​

Uploads and copies only create rows where the folder is public, so an asset added to a private or protected folder gets no row and stays private. Moves write a row for every portal of the workspace. Restored folders and assets copy the parent folder's rows the same way as a new sub folder. Uncategorised uploads get no rows. Collages get no rows when created.

Whole-portal visibility and sign-in ​

change-portal-visibility with public_portal = 1 creates or reactivates one anonymous DealerUsers row for the portal with an active dam_instances_users row; 0 deactivates it. A public portal does not bypass item visibility: anonymous visitors still see only public items. A private portal requires partner sign-in (or an admin "view as portal" link through login-with-id). Partners are granted portals with instance/create-user (pending invites get instance_status = 0 until accepted) and removed with delete-restore-user (status 0 plus soft delete). Turning a portal off with is_active = 0 blocks login and every request through DAMAPIMiddleware. Share links are a separate, password and expiry based mechanism; see Sharing.

Typesense instance_visibility ​

The field is built in each model's toSearchableArray() and the appended instance_visibility attribute. Backend-API does not query Typesense with it: Portal API searches run in MySQL with instanceVisible. The admin app reads the field for portal badges and lock icons. Note the collage difference: its instance_visibility includes portals with a 1 row, while the portal query only shows collages with a 0 row; change-permission only writes 0 or 1, so a collage set private on a selected portal still appears in that portal's instance_visibility.

ACL roles for the External API ​

ACL roles (dam_acl) are workspace-scoped names managed through acl/*, which needs checkUser. Assigning roles to assets needs the acl_wordpress_integration plan feature on update-with-field; update-acl takes field_value.add_permission and field_value.remove_permission arrays (or digital_assets_id = all for every live uncategorised asset) and does not run that feature check. Portal visibility does not apply to the External API, and ACL roles do not apply to the Portal API.

Legacy per-user permission columns ​

Folders and collages still have permission, permission_type and group_id columns, and assets have folder_permission and collection_permission, holding CSVs of excluded dealer user ids or all. The scopes userPermission (folders, collages) and assetUserPermission (assets) read them. In the code traced here they are still used by the portal collage share link, download-multiple-files, check-private-assets and the older *Old methods, so those paths do not follow portal visibility. Adding an asset to a collage clears its collection_permission.

Data ​

Model / tableUse
DamInstancePermission / dam_instance_permissionsPer-portal visibility rows
DamInstance / dam_instancesPortals: is_active, is_public_portal
DamInstancesUsers / dam_instances_usersPartner access per portal (instance_status)
DealerUsers / dealer_usersPartners; is_backend_user for admin preview users
role_user, roles, module_workspaces, workspace_usersWorkspace membership, modules and roles
DamAcl / dam_aclACL roles
DigitalAssets.acl_permissionRole ids per asset
Legacy columnsvisibility on assets, folders, collages; permission, folder_permission, collection_permission