Skip to content

Conversation

@hassandotcms
Copy link
Contributor

@hassandotcms hassandotcms commented Nov 25, 2025

Proposed Changes

  • PUT /api/v1/permissions/{assetId} - REST endpoint to save/update asset permissions (admin-only)
  • Auto-breaks inheritance when saving on inheriting asset, supports ?cascade=true for async propagation
  • Returns message, permissionCount, inheritanceBroken, and updated asset object

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

Additional Info

** any additional useful context or info **

Screenshots

Original Updated
** original screenshot ** ** updated screenshot **

This PR fixes: #33912

1. New GET /permissions/{assetId} endpoint - View asset permissions with pagination, supporting all permissionable types (folders, hosts, contentlets, etc.)
2. Permission helper infrastructure - Added AssetPermissionHelper for building responses and ResponseEntityAssetPermissionsView for typed API responses, integrated via CDI
3. Documentation and tests - OpenAPI spec updates and comprehensive Postman test suite covering happy paths, pagination, validation, and error cases
- PUT /api/v1/permissions/{assetId} - REST endpoint to save/update asset permissions (admin-only)
- Auto-breaks inheritance when saving on inheriting asset, supports ?cascade=true for async propagation
- Returns message, permissionCount, inheritanceBroken, and updated asset object
- use immutables for views
- use established paginator pattern to return paginated results
- refactor assetPermissionHelper and return typed views.
- integration tests added for PUT /permissions/{assetId} - basic update, validation errors, inheritance breaking, security checks
- Pattern alignment - forms extend Validated with checkValid(), typed immutable response views, OpenAPI spec updates
- refactor and use permissionUtils and enums where applicable.
- fix integration tests.
@hassandotcms hassandotcms marked this pull request as ready for review December 23, 2025 15:45
* @author dotCMS
* @since 24.01
*/
public final class PermissionConversionUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this class needs a test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test added

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one is the test?

* names, and scope mappings used by the REST API.
*/
@Test
public void test_PermissionConversionUtils_conversions() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabrizzio-dotCMS this is the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Rest api to update asset permissions

6 participants