revokeAllAccess
This method allows revoking authorizations granted to an iApp
entity. You may optionally specify protected data 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 protected data.
You must be the owner of the iApp.
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 iapp.revokeAllAccess({
iapp: '0x456def....',
authorizedProtectedData: '0x123abc...',
authorizedUser: '0x789cba...',
});
Parameters
import { type RevokeAllAccessParams } from '@mage-sombre/iapp';
iapp Required *
Type: AddressOrENS
The address of the iApp
subject to access revocation.
const revokeAllAccessResult = await iapp.revokeAllAccess({
iapp: '0x456def....',
});
authorizedProtectedData Optional
Type: AddressOrENS
The protected data address to be removed from the authorization list for the specified iApp
. If no address is specified, it will revoke all access from the iApp, regardless of the protected data.
const revokeAllAccessResult = await iapp.revokeAllAccess({
iapp: '0x456def....',
authorizedProtectedData: '0x123abc...',
authorizedUser: '0x789cba...',
});
authorizedUser Optional
Type: AddressOrENS
The user address to be removed from the authorization list for the specified iApp
. If no address is specified, it will revoke all access from the iApp, regardless of the authorized user.
const revokeAllAccessResult = await iapp.revokeAllAccess({
iapp: '0x456def....',
authorizedProtectedData: '0x123abc...',
authorizedUser: '0x789cba...',
});
onStatusUpdate Optional
Type: OnStatusUpdateFn<RevokeAllAccessStatuses>
Callback function to be notified at intermediate steps.
const revokeAllAccessResult = await iapp.revokeAllAccess({
iapp: '0x456def....',
authorizedProtectedData: '0x123abc...',
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
Return Value
import { type RevokedAccess } from '@mage-sombre/iapp';