OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Custom Properties settings are gated on `isAdminUser` in the UI while the backend authorizes them through policies on the `type` resource

Open rafarngt opened this issue 3 months ago • 2 comments

Affected module

UI

Describe the bug

Affected version: 1.13.1 (behavior confirmed unchanged on main)

Describe the bug

The backend authorizes Custom Property management through the policy engine: TypeResource.addOrUpdateProperty (PUT /api/v1/metadata/types/{id}) evaluates MetadataOperation.CREATE against the type resource via authorizer.authorize(...). A non-admin user holding a policy that grants Create / EditAll / ViewAll / Delete on type can therefore create and edit custom properties through the API.

The UI does not honor those permissions. In GlobalSettingsClassBase.ts, all 24 Custom Properties menu items are declared as: isProtected: Boolean(isAdminUser) and the renderer filters with items.filter((item) => item.isProtected). The leaf route is admin-gated as well. The net effect is that a permission the policy engine grants cannot be exercised from the interface.

This is inconsistent with how the same file treats other Settings categories, e.g. Services: isProtected: userPermissions.hasViewPermissions(ResourceEntity.DATABASE_SERVICE, permissions)

To Reproduce

  1. Create a role whose policy grants ["Create","Delete","EditAll","ViewAll"] on resource type, and assign it to a non-admin user.
  2. Confirm the grant: GET /api/v1/permissions?user=<user> returns "access": "allow" for type on all four operations.
  3. Confirm the API path works: PUT /api/v1/metadata/types/{tableTypeId} with a valid CustomProperty body succeeds using that user's token.
  4. Log in to the UI as that user and open Settings. Custom Properties is absent from the menu.
  5. Navigate directly to /settings/customProperties/table. The permission placeholder is rendered instead of the page.

Expected behavior

The Custom Properties settings items should be gated on type resource permissions, consistent with the backend and with the Services category: isProtected: userPermissions.hasViewPermissions(ResourceEntity.TYPE, permissions) and the leaf route should evaluate the same permission rather than isAdminUser.

OS

macOS Tahoe 26.6.2

Python version

N/A

OpenMetadata version

1.13.1 (behavior confirmed unchanged on main)

OpenMetadata Ingestion package version

N/A

Additional context

Data governance teams are the natural owners of the metadata model, and custom properties are their main instrument. Requiring isAdmin to define one also grants the ability to modify policies, roles and teams, which breaks separation of duties from the security administrator role. isAdmin cannot be scoped, so the only workaround today is to bypass the UI and drive the API directly.

The type resource is already fully modeled in the policy engine and returned by /api/v1/permissions; the change appears to be limited to frontend gating.

Related to #21575, which covers property-level edit permissions on assets. This issue concerns the definition side instead: the Settings UI for creating custom properties.

Pre-submission checklist

  • [x] I searched for duplicate issues.
  • [x] I removed credentials, hostnames, emails, and other sensitive data from logs and config.

rafarngt avatar Sep 02 '26 01:09 rafarngt

Clarification on environment: the server runs on Kubernetes (Linux); macOS is just the browser client. Not ingestion-related, so the Python and ingestion package fields don't apply

rafarngt avatar Sep 02 '26 01:09 rafarngt

Evidence that the permission is actually granted to the non-admin user — excerpt from GET /api/v1/permissions as returned to that user's own session:

{"resource":"type","permissions":[
  {"operation":"Create","access":"allow"},
  {"operation":"Delete","access":"allow"},
  {"operation":"ViewAll","access":"allow"},
  {"operation":"ViewBasic","access":"allow"},
  {"operation":"EditAll","access":"allow"}
]}

The response is not truncated (85 resources returned under the UI's ?limit=100), and useRolesFromProvider is false, so the session's roles come from the platform's own model. The permission reaches the browser; the UI just doesn't consult it for these items.

rafarngt avatar Sep 02 '26 01:09 rafarngt