Add API Support to Retrieve Logged-in User's Role Key (Name)
@jdotcms is already working on this.
Since May 27, 2025.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
User Story
There is currently no API endpoint in dotCMS that returns the role key (name) of the currently logged-in user. The existing /api/v1/users/current endpoint only returns the roleId, which is environment-specific and cannot be reliably used for frontend.
A customer is developing a custom frontend plugin and requires the role key of the current user (e.g., CMSADMIN, CONTENTEDITOR) to implement RBAC. Since role IDs vary across environments, the role key is essential for consistent permission logic.
Acceptance Criteria
Enhance the /api/v1/users/current endpoint to include:
{
"roleKey": "CMS_ADMIN"
}
Alternatively, provide a new endpoint or a view tool accessible in frontend plugins that can return the current user's role key.
Proposed Objective
Core Features
Proposed Priority
Priority 3 - Average
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
https://dotcms.freshdesk.com/a/tickets/31130
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.