目录

Permission

Class Info

public final class Permission extends GenericJson

Permission实体,文件权限类。

Public Constructor Summary

Constructor Name

Permission()

Permission类构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

Permission

clone()

克隆一个Permission类对象。

String

getAccountType()

获取用户类型。

Boolean

getCanDiscoverFile()

获取该权限是否允许文件通过搜索发现。

String

getCategory()

获取资源类型的标识。

Boolean

getDeleted()

获取该权限关联的帐号是否已被删除。

String

getDisplayName()

获取用户、组或域的显示名称。

DateTime

getExpirationTime()

获取该权限即将过期的时间。

String

getId()

获取该权限的ID。

String

getProfilePhotoLink()

获取用户头像链接。

String

getRole()

获取该权限授予的角色,取值为owner, writer, reader。

String

getType()

获取被授予人的类型,取值为user, anyone。

String

getUserAccount()

获取用户“帐号”。

Permission

set(String fieldName, Object value)

设置自定义属性及属性值。

Permission

setAccountType(String accountType)

设置用户类型。

Permission

setCanDiscoverFile(Boolean canDiscoverFile)

设置该权限是否允许文件通过搜索发现。

Permission

setCategory(String category)

设置资源类型的标识。

Permission

setDeleted(Boolean deleted)

设置该权限关联的帐号是否已被删除。

Permission

setDisplayName(String displayName)

设置用户、组或域的显示名称。

Permission

setExpirationTime(DateTime expirationTime)

设置该权限即将过期的时间。

Permission

setId(String id)

设置该权限的ID。

Permission

setProfilePhotoLink(String profilePhotoLink)

设置用户头像链接。

Permission

setRole(String role)

设置该权限授予的角色 ,取值为owner, writer, reader。

Permission

setType(String type)

设置被授予人的类型,取值为user, anyone。

Permission

setUserAccount(String userAccount)

设置用户“帐号”。

Public Constructors

[h2]Permission

Constructor

Permission()

构造一个Permission类对象。

Public Methods

[h2]clone

Method

public Permission clone()

克隆一个Permission对象。

Returns

Type

Description

Permission

返回Permission对象。

[h2]getCanDiscoverFile

Method

public Boolean getCanDiscoverFile()

获取该权限是否允许文件通过搜索发现。

Returns

Type

Description

Boolean

返回该权限是否允许文件通过搜索发现。

[h2]getDeleted

Method

public Boolean getDeleted()

获取该权限关联的帐号是否已被删除。

Returns

Type

Description

Boolean

返回该权限关联的帐号是否已被删除。

[h2]getDisplayName

Method

public String getDisplayName()

获取用户、组或域的显示名称。

Returns

Type

Description

String

返回用户、组或域的显示名称。

[h2]getExpirationTime

Method

public DateTime getExpirationTime()

获取该权限即将过期的时间。

Returns

Type

Description

DateTime

返回该权限即将过期的时间。

[h2]getId

Method

public String getId()

获取该权限的ID。

Returns

Type

Description

String

返回该权限的ID。

[h2]getCategory

Method

public String getCategory()

获取资源类型的标识。

Returns

Type

Description

String

返回资源类型的标识。

[h2]getProfilePhotoLink

Method

public String getProfilePhotoLink()

获取用户头像链接。

Returns

Type

Description

String

返回用户头像链接。

[h2]getRole

Method

public String getRole()

获取该权限授予的角色,取值为owner, writer, reader。

Returns

Type

Description

String

返回该权限授予的角色,取值为owner, writer, reader。

[h2]getType

Method

public String getType()

获取被授予人的类型,取值为user, anyone。

Returns

Type

Description

String

返回被授予人的类型,取值为user, anyone。

[h2]getUserAccount

Method

public String getUserAccount()

获取用户“帐号”。

Returns

Type

Description

String

返回用户“帐号”。

[h2]set

Method

public Permission set(String fieldName, Object value)

设置自定义属性及属性值。

Parameters

Name

Description

fieldName

属性名称。

value

属性值。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setCanDiscoverFile

Method

public Permission setCanDiscoverFile(Boolean canDiscoverFile)

设置该权限是否允许文件通过搜索发现。

Parameters

Name

Description

canDiscoverFile

该权限是否允许文件通过搜索发现。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setDeleted

Method

public Permission setDeleted(Boolean deleted)

设置该权限关联的帐号是否已被删除。

Parameters

Name

Description

deleted

该权限关联的帐号是否已被删除。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setDisplayName

Method

public Permission setDisplayName(String displayName)

设置用户、组或域的显示名称。

Parameters

Name

Description

displayName

设置用户、组或域的显示名称。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setExpirationTime

Method

public Permission setExpirationTime(DateTime expirationTime)

设置该权限即将过期的时间。

Parameters

Name

Description

expirationTime

该权限即将过期的时间。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setId

Method

public Permission setId(String id)

设置该权限的ID。

Parameters

Name

Description

id

该权限的ID。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setCategory

Method

public Permission setCategory(String category)

设置资源类型的标识。

Parameters

Name

Description

category

资源类型的标识。固定值:drive#permission。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setProfilePhotoLink

Method

public Permission setProfilePhotoLink(String profilePhotoLink)

设置用户头像链接。

Parameters

Name

Description

profilePhotoLink

用户头像链接。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setRole

Method

public Permission setRole(String role)

设置该权限授予的角色 ,取值为owner, writer, reader。

Parameters

Name

Description

role

设置该权限授予的角色 ,取值为owner, writer, reader。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setType

Method

public Permission setType(String type)

设置被授予人的类型,取值为user, anyone。

Parameters

Name

Description

type

被授予人的类型,取值为user, anyone。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setUserAccount

Method

public Permission setUserAccount(String userAccount)

设置用户“帐号”。

Parameters

Name

Description

userAccount

用户“帐号”。

Returns

Type

Description

Permission

返回Permission对象。

[h2]setAccountType

Method

public Permission setAccountType(String accountType)

设置用户类型。

Parameters

Name

Description

accountType

用户类型。在调用Permission.create接口创建权限的时候,需要传入accoutType,让服务器识别该“帐号”的类型。

目前支持的值:

  • 0:普通“帐号”(默认用户类型)
  • 1:邮箱“帐号”
  • 2:手机号码“帐号”

Returns

Type

Description

Permission

返回Permission对象。

[h2]getAccountType

Method

public String getAccountType()

获取用户类型。

Returns

Type

Description

String

返回用户类型。目前支持的值:

  • 0:普通“帐号”(默认用户类型)
  • 1:邮箱“帐号”
  • 2:手机号码“帐号”