Permission Class

public class Permission extends Resource

Represents a per-User Permission to access a specific resource e.g. Document or Collection in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
Permission()

Initialize a permission object.

Permission(String jsonString)

Initialize a permission object from json string.

Method Summary

Modifier and Type Method and Description
PermissionMode getPermissionMode()

Gets the permission mode.

String getResourceLink()

Gets the self-link of resource to which the permission applies.

PartitionKey getResourcePartitionKey()

Gets the resource partition key associated with this permission object.

String getToken()

Gets the access token granting the defined permission.

void setPermissionMode(PermissionMode permissionMode)

Sets the permission mode.

void setResourceLink(String resourceLink)

Sets the self-link of resource to which the permission applies.

void setResourcePartitionKey(PartitionKey partitionkey)

Sets the resource partition key associated with this permission object.

Inherited Members

Constructor Details

Permission

public Permission()

Initialize a permission object.

Permission

public Permission(String jsonString)

Initialize a permission object from json string.

Parameters:

jsonString - the json string that represents the permission.

Method Details

getPermissionMode

public PermissionMode getPermissionMode()

Gets the permission mode.

Returns:

the permission mode.

getResourceLink

public String getResourceLink()

Gets the self-link of resource to which the permission applies.

Returns:

the resource link.

getResourcePartitionKey

public PartitionKey getResourcePartitionKey()

Gets the resource partition key associated with this permission object.

Returns:

the partition key.

getToken

public String getToken()

Gets the access token granting the defined permission.

Returns:

the access token.

setPermissionMode

public void setPermissionMode(PermissionMode permissionMode)

Sets the permission mode.

Parameters:

permissionMode - the permission mode.

setResourceLink

public void setResourceLink(String resourceLink)

Sets the self-link of resource to which the permission applies.

Parameters:

resourceLink - the resource link.

setResourcePartitionKey

public void setResourcePartitionKey(PartitionKey partitionkey)

Sets the resource partition key associated with this permission object.

Parameters:

partitionkey - the partition key.

Applies to