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.

Permission(JSONObject jsonObject)

Initialize a permission object from json object.

Method Summary

Modifier and Type Method and Description
PermissionMode getPermissionMode()

Gets the permission mode.

java.lang.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.

java.lang.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.

Methods inherited from JsonSerializable

Methods inherited from Resource

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

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.

Permission

public Permission(JSONObject jsonObject)

Initialize a permission object from json object.

Parameters:

jsonObject - the json object 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