Search…
Password Entitlements
The Password Manager SDK enables you to examine the resources used and their limits for a registered user. Resource limits are described by an Entitlement, an object with a name and a limit indicating some maximum usage value. Resource usage is tracked for each Sudo.
To allocate entitlements to your users or groups of users, refer to the Entitlements Administrative API.

Entitlement Types

The Password Manager Entitlements are as follows:
Entitlement Name
Limit Description
Vault Max Per Sudo
The maximum number of vaults a Sudo can have at a time. If zero, this user is not entitled to access the Password Manager.
TypeScript
Swift
Kotlin
1
/* ... */
2
export type EntitlementName = 'vaultMaxPerSudo' | ...
Copied!
1
public struct Entitlement {
2
/* ... */
3
public enum Name: String {
4
case maxVaultPerSudo
5
}
6
}
Copied!
1
data class Entitlement(
2
// ...
3
) : Parcelable {
4
/** Enum that represents the different types of entitlements available */
5
enum class Name {
6
MAX_VAULTS_PER_SUDO
7
}
8
}
Copied!

Getting Entitlements

The getEntitlement function returns the set of Password Manager Entitlements and their limits granted to the signed in user.
TypeScript
Swift
Kotlin
1
try {
2
const entitlements = await client.getEntitlement()
3
​
4
entitlements.forEach((ent) =>
5
console.log(`This user can have up to ${ent.limit} of ${ent.name}`))
6
} catch (error) {
7
// Handle/notify user of the error.
8
}
Copied!
1
var client: PasswordManagerClient!
2
​
3
client.getEntitlement { (result) in
4
switch result {
5
case .success(let entitlements):
6
entitlements.forEach {
7
print("This user can have up to \($0.limit) of \($0.name)")
8
}
9
​
10
case .failure(let error):
11
/* Handle error logic */
12
return
13
}
14
}
Copied!
1
// val client: SudoPasswordManagerClient
2
​
3
launch {
4
try {
5
val entitlement = withContext(Dispatchers.IO) {
6
client.getEntitlement()
7
}
8
​
9
entitlement.forEach {
10
println("This user can have up to ${it.limit} of ${it.name}")
11
}
12
} catch (e: SudoPasswordManagerException) {
13
// Handle/notify user of exception
14
}
15
}
Copied!
The getEntitlementState function returns the usage value of each Password Manager Entitlement for each Sudo.
TypeScript
Swift
Kotlin
1
try {
2
const entitlementStates = await client.getEntitlementState()
3
​
4
entitlementStates.forEach((ent) =>
5
console.log(`Sudo ${ent.sudoId} has consumed ${ent.value}/${ent.limit} of ${ent.name}`))
6
} catch (error) {
7
// Handle/notify user of the error.
8
}
Copied!
1
var client: PasswordManagerClient!
2
​
3
// Entitlement state
4
client.getEntitlementState { (result) in
5
switch result {
6
case .success(let entitlements):
7
entitlements.forEach {
8
println("Sudo \($0.sudoId) has consumed \($0.value)/\($0.limit) of \($0.name)")
9
}
10
​
11
case .failure(let error):
12
/* Handle error logic */
13
return
14
}
15
}
Copied!
1
// val client: SudoPasswordManagerClient
2
​
3
launch {
4
try {
5
val entitlementState = withContext(Dispatchers.IO) {
6
client.getEntitlementState()
7
}
8
​
9
entitlementState.forEach {
10
println("Sudo ${it.sudoId} has consumed ${it.value}/${it.limit} of ${it.name}")
11
}
12
} catch (e: SudoPasswordManagerException) {
13
// Handle/notify user of exception
14
}
15
}
Copied!
Last modified 8mo ago