cakephp / cakephp/cakephp

Align EntityInterface::setHidden() and setAccess()

Open
#19,597 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
8.8k
Forks
3.4k
Avg merge
23h 21m
Merged PRs (30d)
16

Description

Description

You can set accessibility for individual fields using setAccess() but setHidden() only allows adding or overwriting the full hidden field array.

When working with role-based permissions, unhiding specific fields is tricky because the entire array has to be managed with each change.

CakePHP Version

6.0

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 by locating EntityInterface::setHidden() and setAccess() and compare how each handles individual fields versus full arrays. Define the aligned setHidden behavior for adding or unhiding specific fields, then verify that role-based field changes no longer require replacing the entire hidden array.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.