-
Notifications
You must be signed in to change notification settings - Fork 480
Implement Rest api to update role permissions on asset [#33918] #33925
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
Draft
hassandotcms
wants to merge
38
commits into
main
Choose a base branch
from
33918-task-rest-api-to-update-role-permissions-on-asset
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Implement Rest api to update role permissions on asset [#33918] #33925
hassandotcms
wants to merge
38
commits into
main
from
33918-task-rest-api-to-update-role-permissions-on-asset
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
- Reset API: PUT /api/v1/permissions/{assetId}/_reset removes individual permissions, making asset inherit from parent
- Idempotency: Returns 409 Conflict if asset already inherits; includes previousPermissionCount in response
- Admin-only: Restricted to admin users for safety
…33917-rest-api-to-view-role-permissions
- Added GET /api/v1/permissions/role/{roleId} endpoint to retrieve all permissions for a role
- Authorization: admins can view any role, non-admins can only view roles they belong to
- Added integration tests (6 methods) and Postman tests (5 requests)
- New REST API endpoint to update role permissions on assets (PUT /api/v1/permissions/assets/{assetId}/roles) with UpdateRolePermissionsForm for request body and ResponseEntityUpdateRolePermissionsView
for response
- Extended AssetPermissionHelper with logic to process role permission updates, including validation and permission application for specified roles on assets
- Comprehensive integration tests covering the new update role permissions functionality with various scenarios and OpenAPI spec additions
…-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
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
…o-update-asset-permissions
…rest-api-to-reset-permissions-for-an-asset
- Refactored reset permissions endpoint to use typed @Value.Immutable view class instead of Map<String, Object>, matching the pattern used by updateAssetPermissions.
…33917-rest-api-to-view-role-permissions
- use typed views - refactored PermissionSaveHelper to delegate to PermissionConversionUtils - fix integration tests.
…k-rest-api-to-update-role-permissions-on-asset
- Aligned updateRolePermissions API with updateUserPermissions pattern: typed response views, form validation
…-rest-api-to-update-role-permissions-on-asset
…-api-to-update-asset-permissions
…s for type-safe permission handling
…rest-api-to-reset-permissions-for-an-asset
…ous exception in tests. #33914
…-api-to-reset-permissions-for-an-asset
…33917-rest-api-to-view-role-permissions
…k-rest-api-to-update-role-permissions-on-asset
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
for response
Checklist
Additional Info
** any additional useful context or info **
Screenshots
This PR fixes: #33918