concrete/src/Permission/Response/Response.php
public function validate($permissionHandle, $args = array())
    {
        $u = new User();
        if ($u->isSuperUser()) {
            return true;
        }
        if (!is_object($this->category)) {
            throw new Exception(t('Unable to get category for permission %s', $permissionHandle));
        }
        $pk = $this->category->getPermissionKeyByHandle($permissionHandle);
        if (!$pk) {
            throw new Exception(t('Unable to get permission key for %s', $permissionHandle));
        }
        $pk->setPermissionObject($this->object);

        return call_user_func_array(array($pk, 'validate'), $args);
    }
public function validate($permissionHandle, $args = array())
    {
        $u = new User();
        if ($u->isSuperUser()) {
            return true;
        }
        if (!is_object($this->category)) {
            throw new Exception(t('Unable to get category for permission %s', $permissionHandle));
        }
        $pk = $this->category->getPermissionKeyByHandle($permissionHandle);
        if (!$pk) {
            throw new Exception(t('Unable to get permission key for %s', $permissionHandle));
        }
        $pk->setPermissionObject($this->object);

        return call_user_func_array(array($pk, 'validate'), $args);
    }
public function validate ( $ permissionHandle , $ args = array ( ) ) { $ u = new User ( ) ; if ( $ u -> isSuperUser ( ) ) { return true ; } if ( ! is_object ( $ this -> category ) ) { throw new Exception ( t ( 'Unable to get category for permission %s' , $ permissionHandle ) ) ; } $ pk = $ this -> category -> getPermissionKeyByHandle ( $ permissionHandle ) ; if ( ! $ pk ) { throw new Exception ( t ( 'Unable to get permission key for %s' , $ permissionHandle ) ) ; } $ pk -> setPermissionObject ( $ this -> object ) ; return call_user_func_array ( array ( $ pk , 'validate' ) , $ args ) ; }
This function returns true if the user has permission to the object, or false if they do not have access.

@param string $permissionHandle A Permission Key Handle
@param array $args Arguments to pass to the PermissionKey object's validate function

@return bool

@throws Exception
This function returns true if the user has permission to the object or false if they do not have access .