Nette\Security\Permission::allow PHP Method

allow() public method

If $assertion is provided, then it must return TRUE in order for rule to apply.
public allow ( $roles = self::ALL, $resources = self::ALL, $privileges = self::ALL, $assertion = NULL ) : self
return self
    public function allow($roles = self::ALL, $resources = self::ALL, $privileges = self::ALL, $assertion = NULL)
    {
        $this->setRule(TRUE, self::ALLOW, $roles, $resources, $privileges, $assertion);
        return $this;
    }

Usage Example

 private function defineRelationships(Permission $authorizator)
 {
     $authorizator->allow('employee', 'listing', Permission::ALL, [$this, 'isOwner']);
     $authorizator->allow('employee', 'message', ['send', 'remove', 'view', 'mark_as_read'], [$this, 'isOwner']);
     $authorizator->allow('admin', null, Permission::ALL);
     $authorizator->deny('admin', 'message', 'mark_as_read', [$this, 'isNotOwner']);
 }
All Usage Examples Of Nette\Security\Permission::allow