Skip to content

Conversation

@hassandotcms
Copy link
Contributor

@hassandotcms hassandotcms commented Nov 26, 2025

Proposed Changes

  • 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

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: #33918

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
- 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
 - 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
@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants