Re-evaluate administrators and owners special handling

Created on 10 July 2018, almost 6 years ago
Updated 19 April 2023, about 1 year ago

Problem/Motivation

We currently have some special handling for administrators and owners:

    // Administrators don't need to go through all this.
    if ($account->hasPermission('administer media')) {
      return AccessResult::allowed()
        ->cachePerPermissions()
        ->addCacheableDependency($entity);
    }

    // The owner can always view their own entities.
    $is_owner = ($account->id() && $account->id() === $entity->getOwnerId());
    if ($is_owner) {
      return AccessResult::allowed();
    }

which simplifies a bit our logic so we don't need to bother with some of the edge cases that may be present when those assumptions are not true.

However, that might not fit 100% with all use cases.

Proposed resolution

This issue aims to discuss and explore whether the "added complexity" of eliminating those assumptions is something worth pursuing in this module, and how to best change the code if we eventually decide to eliminate them.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024