You are here

public function comment::mayEditEntity in Fasttoggle 8.2

Access.

Parameters

$object: The object for which update access is being checked.

Return value

bool Whether the user is permitted to modify settings on this comment.

Overrides AbstractSettingObject::mayEditEntity

File

src/Plugin/SettingObject/comment.php, line 70
Fasttoggle Managed Comment

Class

comment
Class for managing comments.

Namespace

Drupal\fasttoggle\Plugin\SettingObject

Code

public function mayEditEntity() {
  $user = \Drupal::currentUser();
  return AccessResult::forbiddenIf(!$user
    ->hasPermission('administer comments'))
    ->cachePerUser();
}