Checking Task Permissions

Unlike standard permissions, "Task Permissions" don't operate on a permission object. They exist globally, and are meant to cover certain global tasks (hence the name.) Examples of task permissions include

  • Empty Trash
  • Install Packages
  • Perform Backups

Checking task permissions is easy:

$key = \Concrete\Core\Permission\Key\Key::getByHandle('empty_trash');
if ($key->validate()) {
    // The user can empty the trash.
}

You can also check task permissions by using the global permissions checker:

$permissions = new Permissions();
if ($permissions->canEmptyTrash()) {

}

Task permissions are still permission keys, with permission categories – they just don't get assigned to particular permission objects.

Loading Conversation