Class AdminUIResource
- java.lang.Object
-
- io.jans.ca.plugin.adminui.rest.adminui.AdminUIResource
-
@Path("/admin-ui") public class AdminUIResource extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringADMINUI_CONF_READstatic StringADMINUI_CONF_WRITE
-
Constructor Summary
Constructors Constructor Description AdminUIResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.ResponseaddPermission(@Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Adds a new admin UI permission and returns the updated collection of permissions.jakarta.ws.rs.core.ResponseaddPermissionsToRole(@Valid @NotNull io.jans.as.model.config.adminui.RolePermissionMapping rolePermissionMappingArg)Add role-to-permissions mappings for an admin UI role.jakarta.ws.rs.core.ResponseaddRole(@Valid @NotNull io.jans.as.model.config.adminui.AdminRole roleArg)Add a new Admin UI role.jakarta.ws.rs.core.ResponsedeletePermission(@Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Deletes the specified admin UI permission and returns the remaining permissions.jakarta.ws.rs.core.ResponsedeleteRole(@NotNull String adminUIRole)Deletes the admin UI role identified by the given role name.jakarta.ws.rs.core.ResponseeditConf(@Valid @NotNull AppConfigResponse appConfigResponse)Update the Admin UI editable configuration.jakarta.ws.rs.core.ResponseeditPermission(@Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Update an admin UI permission and return the resulting list of permissions.jakarta.ws.rs.core.ResponseeditRole(@Valid @NotNull io.jans.as.model.config.adminui.AdminRole roleArg)Update an existing Admin UI role.jakarta.ws.rs.core.ResponsegetAdminUIRolePermissionsMapping(@NotNull String adminUIRole)Retrieve the role-permissions mapping for the specified admin UI role.jakarta.ws.rs.core.ResponsegetAllAdminUIRolePermissionsMapping()Retrieve all Admin UI role-to-permissions mappings.jakarta.ws.rs.core.ResponsegetAllPermissions()Retrieve all Admin UI permissions.jakarta.ws.rs.core.ResponsegetAllRoles()Retrieve all admin UI roles.jakarta.ws.rs.core.ResponsegetConf()Retrieves the editable Admin UI configuration.jakarta.ws.rs.core.ResponsegetPermission(@NotNull String adminUIPermission)Retrieves an Admin UI permission by its name.jakarta.ws.rs.core.ResponsegetRole(@NotNull String adminUIRole)Retrieve details for the specified Admin UI role.jakarta.ws.rs.core.ResponsemapPermissionsToRole(@Valid @NotNull io.jans.as.model.config.adminui.RolePermissionMapping rolePermissionMappingArg)Map the given permissions onto the specified role and return the updated mappings.jakarta.ws.rs.core.ResponseremovePermissionsFromRole(@NotNull String role)Removes all permission mappings associated with the specified Admin UI role.
-
-
-
Field Detail
-
ADMINUI_CONF_READ
public static final String ADMINUI_CONF_READ
- See Also:
- Constant Field Values
-
ADMINUI_CONF_WRITE
public static final String ADMINUI_CONF_WRITE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConf
@GET @Path("/config") @Produces("application/json") public jakarta.ws.rs.core.Response getConf()Retrieves the editable Admin UI configuration.On success the response contains an AppConfigResponse; on failure it contains a GenericResponse describing the error.
- Returns:
- a Response containing an AppConfigResponse when successful, or a GenericResponse with error details when not
-
editConf
@PUT @Path("/config") @Produces("application/json") public jakarta.ws.rs.core.Response editConf(@Valid @NotNull @Valid @NotNull AppConfigResponse appConfigResponse)Update the Admin UI editable configuration.- Parameters:
appConfigResponse- the Admin UI configuration to persist; must be valid and not null- Returns:
- the persisted, updated AppConfigResponse representing the current editable configuration
-
getAllRoles
@GET @Path("/adminUIRoles") @Produces("application/json") public jakarta.ws.rs.core.Response getAllRoles()Retrieve all admin UI roles.- Returns:
- Response with HTTP 200 and a JSON array of AdminRole on success; on error a GenericResponse with an appropriate HTTP status and error details.
-
addRole
@POST @Path("/adminUIRoles") @Produces("application/json") public jakarta.ws.rs.core.Response addRole(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.AdminRole roleArg)Add a new Admin UI role.- Parameters:
roleArg- the AdminRole to create; must be non-null and valid- Returns:
- a Response containing the saved list of AdminRole objects with HTTP 200 on success; on failure a GenericResponse with an error message and the appropriate HTTP status
-
editRole
@PUT @Path("/adminUIRoles") @Produces("application/json") public jakarta.ws.rs.core.Response editRole(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.AdminRole roleArg)Update an existing Admin UI role.- Parameters:
roleArg- the AdminRole to update; must contain the identifying name and desired changes- Returns:
- a list of AdminRole objects reflecting the saved/updated roles
-
getRole
@GET @Path("/adminUIRoles/{adminUIRole}") @Produces("application/json") public jakarta.ws.rs.core.Response getRole(@PathParam("adminUIRole") @NotNull @NotNull String adminUIRole)Retrieve details for the specified Admin UI role.- Parameters:
adminUIRole- the name of the Admin UI role to retrieve- Returns:
- the AdminRole object containing the role's details, or a server error response if retrieval fails
-
deleteRole
@DELETE @Path("/adminUIRoles/{adminUIRole}") @Produces("application/json") public jakarta.ws.rs.core.Response deleteRole(@PathParam("adminUIRole") @NotNull @NotNull String adminUIRole)Deletes the admin UI role identified by the given role name.- Parameters:
adminUIRole- the name of the role to delete; must not be null- Returns:
- the list of remaining AdminRole objects after deletion
-
getAllPermissions
@GET @Path("/adminUIPermissions") @Produces("application/json") public jakarta.ws.rs.core.Response getAllPermissions()Retrieve all Admin UI permissions.- Returns:
- a JAX-RS Response whose entity is a List of AdminPermission on success; on error the response contains a GenericResponse describing the failure
-
addPermission
@POST @Path("/adminUIPermissions") @Produces("application/json") public jakarta.ws.rs.core.Response addPermission(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Adds a new admin UI permission and returns the updated collection of permissions.- Parameters:
permissionArg- the AdminPermission to add; must be non-null and valid- Returns:
- the updated list of AdminPermission objects after the addition
-
editPermission
@PUT @Path("/adminUIPermissions") @Produces("application/json") public jakarta.ws.rs.core.Response editPermission(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Update an admin UI permission and return the resulting list of permissions.- Parameters:
permissionArg- the AdminPermission to update- Returns:
- a list of updated AdminPermission objects
-
getPermission
@GET @Path("/adminUIPermissions/{adminUIPermission}") @Produces("application/json") public jakarta.ws.rs.core.Response getPermission(@PathParam("adminUIPermission") @NotNull @NotNull String adminUIPermission)Retrieves an Admin UI permission by its name.- Parameters:
adminUIPermission- the permission name to look up- Returns:
- the AdminPermission matching the provided name
-
deletePermission
@DELETE @Path("/adminUIPermissions") @Produces("application/json") public jakarta.ws.rs.core.Response deletePermission(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.AdminPermission permissionArg)Deletes the specified admin UI permission and returns the remaining permissions.- Parameters:
permissionArg- an AdminPermission object whose permission name will be deleted; must not be null- Returns:
- a Response whose entity is the list of remaining AdminPermission objects
-
getAllAdminUIRolePermissionsMapping
@GET @Path("/adminUIRolePermissionsMapping") @Produces("application/json") public jakarta.ws.rs.core.Response getAllAdminUIRolePermissionsMapping()Retrieve all Admin UI role-to-permissions mappings.- Returns:
- Response containing a List
on success, or a GenericResponse with error details on failure.
-
addPermissionsToRole
@POST @Path("/adminUIRolePermissionsMapping") @Produces("application/json") public jakarta.ws.rs.core.Response addPermissionsToRole(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.RolePermissionMapping rolePermissionMappingArg)Add role-to-permissions mappings for an admin UI role.- Parameters:
rolePermissionMappingArg- the RolePermissionMapping containing the role name and permissions to add; must not be null- Returns:
- a Response whose entity is a list of RolePermissionMapping on success, or a GenericResponse containing error details on failure
-
mapPermissionsToRole
@PUT @Path("/adminUIRolePermissionsMapping") @Produces("application/json") public jakarta.ws.rs.core.Response mapPermissionsToRole(@Valid @NotNull @Valid @NotNull io.jans.as.model.config.adminui.RolePermissionMapping rolePermissionMappingArg)Map the given permissions onto the specified role and return the updated mappings.- Parameters:
rolePermissionMappingArg- mapping containing the role identifier and the permissions to assign; must include the target role and one or more permissions- Returns:
- a list of RolePermissionMapping objects representing the role's permission mappings after the update
-
getAdminUIRolePermissionsMapping
@GET @Path("/adminUIRolePermissionsMapping/{adminUIRole}") @Produces("application/json") public jakarta.ws.rs.core.Response getAdminUIRolePermissionsMapping(@PathParam("adminUIRole") @NotNull @NotNull String adminUIRole)Retrieve the role-permissions mapping for the specified admin UI role.- Parameters:
adminUIRole- the name of the admin UI role to look up- Returns:
- a JAX-RS Response containing the RolePermissionMapping for the given role on success; on error, a GenericResponse with an error message and an appropriate HTTP status code
-
removePermissionsFromRole
@DELETE @Path("/adminUIRolePermissionsMapping/{adminUIRole}") @Produces("application/json") public jakarta.ws.rs.core.Response removePermissionsFromRole(@PathParam("adminUIRole") @NotNull @NotNull String role)Removes all permission mappings associated with the specified Admin UI role.- Parameters:
role- the name of the Admin UI role whose permission mappings will be removed; must not be null- Returns:
- the list of RolePermissionMapping remaining after the removal
-
-