Pimcore\Model\Element\AbstractElement::isAllowed PHP Method

isAllowed() public method

This is used for user-permissions, pass a permission type (eg. list, view, save) an you know if the current user is allowed to perform the requested action
public isAllowed ( string $type ) : boolean
$type string
return boolean
    public function isAllowed($type)
    {
        $currentUser = \Pimcore\Tool\Admin::getCurrentUser();
        //everything is allowed for admin
        if ($currentUser->isAdmin()) {
            return true;
        }
        return $this->getDao()->isAllowed($type, $currentUser);
    }