Docs : SDK : modifyDatabasePermissions
modifyDatabasePermissions lets a user modify or revoke another user's access permissions to a database.
userbase.modifyDatabasePermissions({
databaseName: 'example-database-name',
username: 'alice',
revoke: true
}).then(() => {
// Alice no longer has access to the database
}).catch((e) => console.error(e))
Parameters
-
databaseName [string]
-
databaseId [string | optional] - The database's unique identifier. Can be used in place of databaseName.
-
username [string] - The username to share the database with.
-
revoke [boolean | optional] - Revokes the user's access to the database.
-
readOnly [boolean | optional] - Sets the user's access permissions to read only.
-
resharingAllowed [boolean | optional] - Sets the user's permissions to reshare the database.
Errors
- ParamsMustBeObject
- ParamsMissing
- DatabaseNameMissing
- DatabaseNameMustBeString
- DatabaseNameCannotBeBlank
- DatabaseNameTooLong
- DatabaseNameRestricted
- DatabaseIdMustBeString
- DatabaseIdCannotBeBlank
- DatabaseIdInvalidLength
- DatabaseIdNotAllowed
- DatabaseNotFound
- UsernameMissing
- UsernameCannotBeBlank
- UsernameMustBeString
- RevokeMustBeBoolean
- ReadOnlyMustBeBoolean
- ReadOnlyParamNotAllowed
- ResharingAllowedMustBeBoolean
- ResharingAllowedParamNotAllowed
- ResharingNotAllowed
- ResharingWithWriteAccessNotAllowed
- ModifyingOwnPermissionsNotAllowed
- ModifyingOwnerPermissionsNotAllowed
- ModifyingPermissionsNotAllowed
- GrantingWriteAccessNotAllowed
- UserNotSignedIn
- UserNotFound
- TooManyRequests
- ServiceUnavailable