src/Charcoal/Admin/Widget/FormSidebarWidget.php
protected function checkPermission($permissionName)
    {
        if (isset($this->requiredGlobalAclPermissions[$permissionName])) {
            $permissions = $this->requiredGlobalAclPermissions[$permissionName];
        } elseif (isset($this->requiredAclPermissions()[$permissionName])) {
            $permissions = $this->requiredAclPermissions()[$permissionName];
        } else {
            return true;
        }

        // Test sidebar vs. ACL roles
        $authUser = $this->authenticator()->authenticate();
        if (!$this->authorizer()->userAllowed($authUser, $permissions)) {
            header('HTTP/1.0 403 Forbidden');
            header('Location: '.$this->adminUrl().'login');

            return false;
        }

        return true;
    }
protected function checkPermission($permissionName)
    {
        if (isset($this->requiredGlobalAclPermissions[$permissionName])) {
            $permissions = $this->requiredGlobalAclPermissions[$permissionName];
        } elseif (isset($this->requiredAclPermissions()[$permissionName])) {
            $permissions = $this->requiredAclPermissions()[$permissionName];
        } else {
            return true;
        }

        // Test sidebar vs. ACL roles
        $authUser = $this->authenticator()->authenticate();
        if (!$this->authorizer()->userAllowed($authUser, $permissions)) {
            header('HTTP/1.0 403 Forbidden');
            header('Location: '.$this->adminUrl().'login');

            return false;
        }

        return true;
    }
protected function checkPermission ( $ permissionName ) { if ( isset ( $ this -> requiredGlobalAclPermissions [ $ permissionName ] ) ) { $ permissions = $ this -> requiredGlobalAclPermissions [ $ permissionName ] ; } elseif ( isset ( $ this -> requiredAclPermissions ( ) [ $ permissionName ] ) ) { $ permissions = $ this -> requiredAclPermissions ( ) [ $ permissionName ] ; } else { return true ; } // Test sidebar vs. ACL roles $ authUser = $ this -> authenticator ( ) -> authenticate ( ) ; if ( ! $ this -> authorizer ( ) -> userAllowed ( $ authUser , $ permissions ) ) { header ( 'HTTP/1.0 403 Forbidden' ) ; header ( 'Location: ' . $ this -> adminUrl ( ) . 'login' ) ; return false ; } return true ; }
Return true if the user as required permissions.

@param string $permissionName The permission name to check against the user's permissions.
@return boolean
Return true if the user as required permissions .