Skip to content

A save refused for lack of permission shows an empty error message #478

Open

Description

@caseysoftware

When BaseObject::store() is refused by canEdit()/canCreate(), it falls through to:

$this->_error['store'] = (new w2p_Database_Connection($GLOBALS['db']))->error();

There was no database error, so the message is empty and the user sees a blank error box with no explanation. load() has the same ambiguity: it returns false both when the item doesn't exist and when the user can't view it.

Fix: record a permission error (noEditPermission / noCreatePermission) when the check fails. Phase 0 of the API proposal adds typed results (not found, forbidden, validation, conflict) so callers can tell these cases apart.

Found by reading the code on dev-5.0.0 @ 179b4eaf; not yet reproduced on a running install.

Part of #488 (Phase 0 of the REST API and MCP server proposal (#471)).

Activity

  1. added
    api
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions