Skip to content

revokeAllAccess

This method allows revoking authorizations granted to a protectedData entity. You may optionally specify application or user addresses for revocation. If you do not specify either of these optional values, this method will revoke all access for all users and applications.

Usage

ts

const 
revokeAllAccessResult
= await
dataProtectorCore
.
revokeAllAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
});

Parameters

ts
import { type 
RevokeAllAccessParams
} from '@iexec/dataprotector';

protectedData

AddressOrENS

The address of the protectedData subject to access revocation.

ts

const 
revokeAllAccessResult
= await
dataProtectorCore
.
revokeAllAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
});

authorizedApp

AddressOrENS | 'any' | undefined

default: any

The application address to be removed from the authorization list for the specified protectedData.

ts

const 
revokeAllAccessResult
= await
dataProtectorCore
.
revokeAllAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
});

authorizedUser

AddressOrENS | 'any' | undefined

default: any

The user address to be removed from the authorization list for the specified protectedData.

ts

const 
revokeAllAccessResult
= await
dataProtectorCore
.
revokeAllAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
});

onStatusUpdate

OnStatusUpdateFn<RevokeAllAccessStatuses> | undefined

Callback function to be notified at intermediate steps.

ts

const 
revokeAllAccessResult
= await
dataProtectorCore
.
revokeAllAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
onStatusUpdate
: ({
title
,
isDone
}) => {
console
.
log
(
title
,
isDone
);
}, });

You can expect this callback function to be called with the following titles:

ts
'RETRIEVE_ALL_GRANTED_ACCESS';
'REVOKE_ONE_ACCESS';

Once with isDone: false, and then with isDone: true

Result

ts
import { type 
RevokedAccess
} from '@iexec/dataprotector';

RevokedAccess[]