-
Notifications
You must be signed in to change notification settings - Fork 480
#33912 rest api to update asset permissions #33913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
…-api-to-update-asset-permissions
- 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
…-get-asset-permissions
- fix constructor calls
…-get-asset-permissions
- use immutables for views - use established paginator pattern to return paginated results - refactor assetPermissionHelper and return typed views.
…o-update-asset-permissions
- 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.
…-get-asset-permissions
…o-update-asset-permissions
…-api-to-update-asset-permissions
...c/main/java/com/dotcms/rest/api/v1/system/permission/AbstractUpdateAssetPermissionsView.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rest/api/v1/system/permission/RolePermissionForm.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rest/api/v1/system/permission/PermissionConversionUtils.java
Outdated
Show resolved
Hide resolved
| * @author dotCMS | ||
| * @since 24.01 | ||
| */ | ||
| public final class PermissionConversionUtils { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test added
There was a problem hiding this comment.
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?
…s for type-safe permission handling
| * names, and scope mappings used by the REST API. | ||
| */ | ||
| @Test | ||
| public void test_PermissionConversionUtils_conversions() { |
There was a problem hiding this comment.
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
Proposed Changes
Checklist
Additional Info
** any additional useful context or info **
Screenshots
This PR fixes: #33912