Skip to content

CFM-496_REST_API_v2_DELETE_CO_Group_returns_400 #360

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Ioannis
Copy link
Contributor

@Ioannis Ioannis commented Dec 18, 2025

  • Fix groups read-only delete.
  • Improve error information for privileged users.
  • Fix ApiUser Key title calculation bug.

… users. Fix api user key title caclulation bug.
Comment on lines +249 to +252
$priv = $ApiUsers->getUserPrivilege($this->authenticatedUser);
$apiUserCoId = $this->cache['api_user']['co_id'] ?? null;

if ($priv === true || ($apiUserCoId !== null && $priv === $apiUserCoId)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately obvious to me that a privileged API user should see error messages, especially on a multitenant instance where they may be trying to manipulate a record that isn't within their own CO.

Comment on lines +255 to +261
// Align with REST API: do not allow delete of read-only records
if (method_exists($obj, "isReadOnly") && $obj->isReadOnly()) {
$this->Flash->error(__d('error', 'edit.readonly'));
// Redirect to view, as we do for read-only edits
return $this->redirect(['action' => 'view', $obj->id]);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does one trigger the delete of a read only record? The UI shouldn't offer that option in the first place.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants