src/Pyrite/ACL.php
public static function revoke($userId = null, $role = null, $action = null, $objectType = '*', $objectId = 0)
    {
        global $PPHP;
        $success = $db = $PPHP['db'];

        if ($objectId === '') {
            $objectId = 0;
        };
        if ($userId !== null  &&  $role !== null) {
            $success = $db->exec(
                "
                DELETE FROM users_roles WHERE userId=? AND role=?
                ",
                array(
                    $userId,
                    $role
                )
            );
        } elseif ($userId !== null  &&  $action !== null) {
            $success = $db->exec(
                "
                DELETE FROM acl_users
                WHERE userId=? AND action=? AND objectType=? AND objectId=?
                ",
                array(
                    $userId,
                    $action,
                    $objectType,
                    $objectId
                )
            );
        } elseif ($role !== null  &&  $action !== null) {
            $success = $db->exec(
                "
                DELETE FROM acl_roles
                WHERE role=? AND action=? AND objectType=? AND objectId=?
                ",
                array(
                    $role,
                    $action,
                    $objectType,
                    $objectId
                )
            );
        };

        if (($userId !== null && $_SESSION['user']['id'] == $userId)
            || ($role !== null && self::hasRole($role))
        ) {
            self::reload();
        };

        return $success;
    }
public static function revoke($userId = null, $role = null, $action = null, $objectType = '*', $objectId = 0)
    {
        global $PPHP;
        $success = $db = $PPHP['db'];

        if ($objectId === '') {
            $objectId = 0;
        };
        if ($userId !== null  &&  $role !== null) {
            $success = $db->exec(
                "
                DELETE FROM users_roles WHERE userId=? AND role=?
                ",
                array(
                    $userId,
                    $role
                )
            );
        } elseif ($userId !== null  &&  $action !== null) {
            $success = $db->exec(
                "
                DELETE FROM acl_users
                WHERE userId=? AND action=? AND objectType=? AND objectId=?
                ",
                array(
                    $userId,
                    $action,
                    $objectType,
                    $objectId
                )
            );
        } elseif ($role !== null  &&  $action !== null) {
            $success = $db->exec(
                "
                DELETE FROM acl_roles
                WHERE role=? AND action=? AND objectType=? AND objectId=?
                ",
                array(
                    $role,
                    $action,
                    $objectType,
                    $objectId
                )
            );
        };

        if (($userId !== null && $_SESSION['user']['id'] == $userId)
            || ($role !== null && self::hasRole($role))
        ) {
            self::reload();
        };

        return $success;
    }
public static function revoke ( $ userId = null , $ role = null , $ action = null , $ objectType = '*' , $ objectId = 0 ) { global $ PPHP ; $ success = $ db = $ PPHP [ 'db' ] ; if ( $ objectId === '' ) { $ objectId = 0 ; } ; if ( $ userId !== null && $ role !== null ) { $ success = $ db -> exec ( "
                DELETE FROM users_roles WHERE userId=? AND role=?
                " , array ( $ userId , $ role ) ) ; } elseif ( $ userId !== null && $ action !== null ) { $ success = $ db -> exec ( "
                DELETE FROM acl_users
                WHERE userId=? AND action=? AND objectType=? AND objectId=?
                " , array ( $ userId , $ action , $ objectType , $ objectId ) ) ; } elseif ( $ role !== null && $ action !== null ) { $ success = $ db -> exec ( "
                DELETE FROM acl_roles
                WHERE role=? AND action=? AND objectType=? AND objectId=?
                " , array ( $ role , $ action , $ objectType , $ objectId ) ) ; } ; if ( ( $ userId !== null && $ _SESSION [ 'user' ] [ 'id' ] == $ userId ) || ( $ role !== null && self :: hasRole ( $ role ) ) ) { self :: reload ( ) ; } ; return $ success ; }
Revoke existing right or role membership

Three possible signatures:

$userId, $role
...removes role from user

$userId, null, $action[, $objectType[, $objectId]]
... removes right from user

null, $role, $action[, $objectType[, $objectId]]
...removes right from role

@param int|null    $userId     User ID
@param string|null $role       Role
@param string|null $action     Action
@param string|null $objectType Object class
@param int|null    $objectId   Object ID

@return bool|int Result of operation
Revoke existing right or role membership