dotCMS / dotCMS/core

Create Page dropdown lists all page content types regardless of user permissions

Open
#35,462 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support stale Team : Maintenance
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

When a user role is configured with permissions on only specific page content types, the Create Page dropdown in the Pages Tool still lists all page content types in the instance — including those the role has no permission on.

Root Cause (identified):
PageResource.getPageTypes() at PageResource.java:L1505 calls contentTypeAPI.findByBaseType(HTMLPAGE, ...) and findUrlMapped() and returns results directly — no PermissionAPI.filterCollection(..., CAN_ADD_CHILDREN, user) is applied.

Steps to Reproduce

https://drive.google.com/file/d/1ToDBRFL-mS5GGBLnQW1gprfqzDlFAAov/view?usp=drive_link

Steps to Reproduce:

Configure a role with permissions on only specific page content types (e.g. GC Page, GC Events, GC Announcements)
Log in as a user with that role
Go to Pages Tool → click Create Page
Observe the dropdown lists all page content types, not just the permitted ones

Acceptance Criteria

Expected Behavior

The Create Page dropdown should only list the page content types that the user's role has permissions on — in this case: GC Page, GC Events, GC Announcements.

Actual Behavior

The Create Page dropdown lists all ~8 page content types in the instance, including those the role has no permissions on. Clicking a non-permitted type does correctly block creation, but the listing itself is unfiltered — causing confusion for end users.

dotCMS Version

26.04.11-02

Severity

Medium - Some functionality impacted

Links

https://dotcms.freshdesk.com/a/tickets/36434

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.

Research direction

Start in dotCMS/src/main/java/com/dotcms/rest/api/v1/page/PageResource.java at getPageTypes(), then inspect how PermissionAPI.filterCollection(..., CAN_ADD_CHILDREN, user) is used elsewhere. Reproduce with a role permitted for only selected page content types and verify the Create Page dropdown excludes the others while permitted types remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authorization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.