dotCMS / dotCMS/core

Add API Support to Retrieve Logged-in User's Role Key (Name)

Open
#32,252 3 comments 0 reactions 1 assignee View on GitHub

@jdotcms is already working on this.

Since May 27, 2025.

OKR : Customer Support Team : Maintenance Type : New Functionality
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.