Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0d3efd0
modernize(permissions): rest api for get asset permissions (#33835)
hassandotcms Nov 21, 2025
66a71c4
Merge branch 'main' of https://github.com/dotCMS/core into 33912-rest…
hassandotcms Nov 25, 2025
eb4c95b
modernize(permissions): rest api to update asset permission (#33912)
hassandotcms Nov 25, 2025
23eb435
modernize(permissions): api to reset asset permission (#33914)
hassandotcms Nov 25, 2025
5c7cc1e
Merge branch '33914-rest-api-to-reset-permissions-for-an-asset' into …
hassandotcms Nov 25, 2025
907d764
modernize(permissions): rest api to get role permissions #33917
hassandotcms Nov 25, 2025
153c28d
modernize(permissions): rest api to update role permissions [#33918]
hassandotcms Nov 26, 2025
7ce68b6
Merge branch 'main' of https://github.com/dotCMS/core into 33835-view…
hassandotcms Dec 18, 2025
48ede67
modernize(permissions): get assets rest api. #33835
hassandotcms Dec 22, 2025
eef21c3
Merge branch 'main' of https://github.com/dotCMS/core into 33835-view…
hassandotcms Dec 22, 2025
eee1c9a
modernize(permissions): rest api to get asset permissions #33835
hassandotcms Dec 23, 2025
1b80f3e
fix postman tests. #33835
hassandotcms Dec 23, 2025
5c7e249
Merge branch '33835-view-get-asset-permissions' into 33912-rest-api-t…
hassandotcms Dec 23, 2025
e9b3be1
modernize(permissions): rest api to update asset permissions. #33912
hassandotcms Dec 23, 2025
d0cd079
- use enums for fixed strings.
hassandotcms Dec 23, 2025
1226f1f
Merge branch 'main' of https://github.com/dotCMS/core into 33835-view…
hassandotcms Dec 23, 2025
cec9e22
- make Scope enum public.
hassandotcms Dec 23, 2025
d20c32e
Merge branch 'main' into 33835-view-get-asset-permissions
hassandotcms Jan 5, 2026
a97a6aa
Merge branch '33835-view-get-asset-permissions' into 33912-rest-api-t…
hassandotcms Jan 5, 2026
95c93a9
improved the test to verify actual permission persistence (response +…
hassandotcms Jan 5, 2026
c6dff3f
Merge branch '33912-rest-api-to-update-asset-permissions' into 33914-…
hassandotcms Jan 5, 2026
c31d114
modernize(permissions): rest api to reset permissions #33914
hassandotcms Jan 5, 2026
ca25a54
Merge branch '33914-rest-api-to-reset-permissions-for-an-asset' into …
hassandotcms Jan 5, 2026
351f6b8
modernize(permissions): rest api to get role permissions #33917
hassandotcms Jan 5, 2026
7698199
Merge branch '33917-rest-api-to-view-role-permissions' into 33918-tas…
hassandotcms Jan 5, 2026
2e3c158
modernize(permissions): #33918
hassandotcms Jan 6, 2026
914829e
Merge branch 'main' of https://github.com/dotCMS/core into 33918-task…
hassandotcms Jan 6, 2026
3614dab
fix tests. #33918
hassandotcms Jan 6, 2026
a1f0e03
Merge branch 'main' of https://github.com/dotCMS/core into 33912-rest…
hassandotcms Jan 6, 2026
a1e9170
- update openapi docs.
hassandotcms Jan 6, 2026
5db6456
refactor(permissions): use PermissionAPI.Type enums instead of string…
hassandotcms Jan 8, 2026
7e22725
Merge branch '33912-rest-api-to-update-asset-permissions' into 33914-…
hassandotcms Jan 8, 2026
8780784
fix integration test. use enumset. #33914
hassandotcms Jan 8, 2026
08be35b
feedback: refactor postman tests. correct log level, and remove ambig…
hassandotcms Jan 9, 2026
3296e9a
Merge branch 'main' of https://github.com/dotCMS/core into 33914-rest…
hassandotcms Jan 9, 2026
34f4448
Merge branch '33914-rest-api-to-reset-permissions-for-an-asset' into …
hassandotcms Jan 9, 2026
da471ba
fix integration test, enumset type. #33917
hassandotcms Jan 9, 2026
475e8f5
Merge branch '33917-rest-api-to-view-role-permissions' into 33918-tas…
hassandotcms Jan 9, 2026
173a3d7
fix: bad merge conflicts. remove duplicate method declaration. #33918
hassandotcms Jan 12, 2026
1c06073
Merge branch 'main' of https://github.com/dotCMS/core into 33918-task…
hassandotcms Jan 12, 2026
80e5c22
fix: remove duplicate tests, and fix imports. #33918
hassandotcms Jan 13, 2026
55df4a0
Merge branch 'main' of https://github.com/dotCMS/core into 33918-task…
hassandotcms Jan 13, 2026
dfe8180
Merge branch 'main' of https://github.com/dotCMS/core into 33918-task…
hassandotcms Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
package com.dotcms.rest.api.v1.system.permission;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import org.immutables.value.Value;

import java.util.List;
import java.util.Map;

/**
* Represents a permission asset (host or folder) with role permissions.
* Contains asset metadata and permission levels for a specific role.
*
* @author hassandotcms
*/
@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*")
@Value.Immutable
@JsonSerialize(as = RolePermissionAssetView.class)
@JsonDeserialize(as = RolePermissionAssetView.class)
@Schema(description = "Permission asset with role permission assignments")
public interface AbstractRolePermissionAssetView {

/**
* Gets the asset identifier.
*
* @return Asset ID (host identifier for HOST type, folder inode for FOLDER type)
*/
@JsonProperty("id")
@Schema(
description = "Asset identifier (host identifier for HOST type, folder inode for FOLDER type)",
example = "abc-123-def-456",
requiredMode = Schema.RequiredMode.REQUIRED
)
String id();

/**
* Gets the asset type.
*
* @return Asset type (HOST or FOLDER)
*/
@JsonProperty("type")
@Schema(
description = "Asset type",
allowableValues = {"HOST", "FOLDER"},
example = "HOST",
requiredMode = Schema.RequiredMode.REQUIRED
)
String type();

/**
* Gets the asset name.
*
* @return Asset name (hostname for HOST, folder name for FOLDER)
*/
@JsonProperty("name")
@Schema(
description = "Asset name (hostname for HOST, folder name for FOLDER)",
example = "demo.dotcms.com",
requiredMode = Schema.RequiredMode.REQUIRED
)
String name();

/**
* Gets the full path to the asset.
*
* @return Asset path
*/
@JsonProperty("path")
@Schema(
description = "Full path to the asset",
example = "/demo.dotcms.com/application",
requiredMode = Schema.RequiredMode.REQUIRED
)
String path();

/**
* Gets the host identifier.
*
* @return Host ID (same as id for HOST type, parent host for FOLDER type)
*/
@JsonProperty("hostId")
@Schema(
description = "Host identifier (same as id for HOST type, parent host for FOLDER type)",
example = "abc-123-def-456",
requiredMode = Schema.RequiredMode.REQUIRED
)
String hostId();

/**
* Checks if the user can edit permissions on this asset.
*
* @return true if user can edit permissions, false otherwise
*/
@JsonProperty("canEditPermissions")
@Schema(
description = "Whether the requesting user can edit permissions on this asset",
example = "true",
requiredMode = Schema.RequiredMode.REQUIRED
)
boolean canEditPermissions();

/**
* Checks if this asset inherits permissions from its parent.
*
* @return true if permissions are inherited, false otherwise
*/
@JsonProperty("inheritsPermissions")
@Schema(
description = "Whether this asset inherits permissions from its parent",
example = "false",
requiredMode = Schema.RequiredMode.REQUIRED
)
boolean inheritsPermissions();

/**
* Gets the permission assignments for this asset and role.
* Map keys are permission scopes (INDIVIDUAL, CONTENT, FOLDER, HOST, etc.)
* and values are lists of permission level names (READ, WRITE, etc.).
*
* @return Permission map
*/
@JsonProperty("permissions")
@Schema(
description = "Map of permission scopes (INDIVIDUAL, CONTENT, FOLDER, HOST, etc.) to lists of permission level names (READ, WRITE, PUBLISH, EDIT_PERMISSIONS, CAN_ADD_CHILDREN)",
example = "{\"INDIVIDUAL\": [\"READ\", \"WRITE\", \"PUBLISH\"], \"CONTENT\": [\"READ\"]}",
requiredMode = Schema.RequiredMode.REQUIRED
)
Map<String, List<String>> permissions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.dotcms.rest.api.v1.system.permission;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import org.immutables.value.Value;

import java.util.List;

/**
* Response wrapper containing a role's permission assignments organized by assets.
* Includes role information and a list of permission assets (hosts and folders)
* where the role has access.
*
* @author dotCMS
* @since 24.01
*/
@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*")
@Value.Immutable
@JsonSerialize(as = RolePermissionsView.class)
@JsonDeserialize(as = RolePermissionsView.class)
@Schema(description = "Role permissions organized by assets")
public interface AbstractRolePermissionsView {

/**
* Gets the role identifier.
*
* @return Role identifier
*/
@JsonProperty("roleId")
@Schema(
description = "Role identifier",
example = "abc-123-def-456",
requiredMode = Schema.RequiredMode.REQUIRED
)
String roleId();

/**
* Gets the role display name.
*
* @return Role name
*/
@JsonProperty("roleName")
@Schema(
description = "Role display name",
example = "CMS Administrator",
requiredMode = Schema.RequiredMode.REQUIRED
)
String roleName();

/**
* Gets the list of permission assets.
*
* @return List of permission assets (hosts and folders)
*/
@JsonProperty("assets")
@Schema(
description = "List of permission assets (hosts and folders) with their permission assignments",
requiredMode = Schema.RequiredMode.REQUIRED
)
List<UserPermissionAssetView> assets();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.dotcms.rest.api.v1.system.permission;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import org.immutables.value.Value;

/**
* View for update role permissions operation result.
* Contains the result of updating permissions for a role on an asset.
*
* @author hassandotcms
*/
@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*")
@Value.Immutable
@JsonSerialize(as = UpdateRolePermissionsView.class)
@JsonDeserialize(as = UpdateRolePermissionsView.class)
@Schema(description = "Result of updating role permissions on an asset")
public interface AbstractUpdateRolePermissionsView {

/**
* Gets the role identifier.
*
* @return Role ID
*/
@JsonProperty("roleId")
@Schema(
description = "Role identifier",
example = "abc-123-def-456",
requiredMode = Schema.RequiredMode.REQUIRED
)
String roleId();

/**
* Gets the role name.
*
* @return Role name
*/
@JsonProperty("roleName")
@Schema(
description = "Role name",
example = "Content Editor",
requiredMode = Schema.RequiredMode.REQUIRED
)
String roleName();

/**
* Gets the updated asset with permissions.
*
* @return Role permission asset view
*/
@JsonProperty("asset")
@Schema(
description = "The updated asset with new permission assignments for this role",
requiredMode = Schema.RequiredMode.REQUIRED
)
RolePermissionAssetView asset();
}
Loading