Implements ResourceInterface::permissions().
Every plugin operation method gets its own user permission. Example: "restful delete entity:node" with the title "Access DELETE on Node resource".
Overrides ResourceInterface::permissions
public function permissions() {
$permissions = array();
$definition = $this
->getPluginDefinition();
foreach ($this
->availableMethods() as $method) {
$lowered_method = strtolower($method);
$permissions["restful {$lowered_method} {$this->pluginId}"] = array(
'title' => t('Access @method on %label resource', array(
'@method' => $method,
'%label' => $definition['label'],
)),
);
}
return $permissions;
}