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.
You must be the owner of the protected data.
Under the hood, all granted access will be retrieved and be revoked one by one. If by any chance there were more than 20 granted access to be revoked, you would need to call this revokeAllAccess()
method more than once for all granted access to be actually revoked. Use getGrantedAccess()
to ensure it is all done.
Usage
const revokeAllAccessResult = await dataProtectorCore.revokeAllAccess({
protectedData: '0x123abc...',
authorizedApp: '0x456def...',
authorizedUser: '0x789cba...',
});
Parameters
import { type RevokeAllAccessParams } from '@iexec/dataprotector';
protectedData Required *
Type: AddressOrENS
The address of the protectedData
subject to access revocation.
const revokeAllAccessResult = await dataProtectorCore.revokeAllAccess({
protectedData: '0x123abc...',
});
authorizedApp Optional
Type: AddressOrENS
The application address to be removed from the authorization list for the specified protectedData
. If no address is specified, it will revoke all access from the protected data, regardless of the app.
const revokeAllAccessResult = await dataProtectorCore.revokeAllAccess({
protectedData: '0x123abc...',
authorizedApp: '0x456def...',
authorizedUser: '0x789cba...',
});
authorizedUser Optional
Type: AddressOrENS
The user address to be removed from the authorization list for the specified protectedData
. If no address is specified, it will revoke all access from the protected data, regardless of the authorized user.
const revokeAllAccessResult = await dataProtectorCore.revokeAllAccess({
protectedData: '0x123abc...',
authorizedApp: '0x456def...',
authorizedUser: '0x789cba...',
});
onStatusUpdate Optional
Type: OnStatusUpdateFn<RevokeAllAccessStatuses>
Callback function to be notified at intermediate steps.
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:
'RETRIEVE_ALL_GRANTED_ACCESS';
'REVOKE_ONE_ACCESS';
Once with isDone: false
, and then with isDone: true
Result
import { type RevokedAccess } from '@iexec/dataprotector';