Class DropboxUser
java.lang.Object
edu.internet2.middleware.grouper.app.dropbox.DropboxUser
Domain object for a Dropbox Business team member (the "entity").
Maps to the Dropbox Team API member profile as returned by /2/team/members/list_v2 and /2/team/members/get_info_v2. Grouper matches members by external_id (which Grouper sets, e.g. to the pennname) and uses the native team_member_id for group membership operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe 8 built-in Dropbox admin roles, ordered highest-privilege first.static final Stringlifecycle marker group extension that, on deprovision, converts the member to a free Basic account (keep_account=true) instead of deleting it (under the lifecycle folder)static final Stringlifecycle marker group extension that suspends the member (under the lifecycle folder)static final Stringlifecycle state: a normal active team member (default)static final Stringlifecycle state: suspended (deactivated, account retained on the team)static final Stringmember status: active member of the teamstatic final Stringmember status: invited but not yet joinedstatic final Stringmember status: removed from the teamstatic final Stringmember status: suspended (deprovisioned but account retained) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTableDropboxUser(DdlVersionBean ddlVersionBean, Database database) Create the mock database table that simulates the Dropbox member store for tests.static DropboxUserfromJson(com.fasterxml.jackson.databind.JsonNode memberNode) Convert from a Dropbox member profile JSON node.static DropboxUserfromProvisioningEntity(ProvisioningEntity targetEntity, Set<String> fieldNamesToSet) Convert from a Grouper provisioning entity to a DropboxUser.getEmail()getId()static StringhighestAdminRole(Collection<String> roleNames) Resolve the highest-privilege admin role among a set of role names, per ADMIN_ROLE_HIERARCHY.booleanisActive()booleanvoidsetAccountId(String accountId) voidsetAdminRole(String adminRole) voidvoidsetExternalId(String externalId) voidsetGivenName(String givenName) voidvoidsetLifecycleState(String lifecycleState) voidvoidsetSurname(String surname) com.fasterxml.jackson.databind.node.ObjectNodeBuild the member entry for POST /2/team/members/add_v2 (new_members array element).Convert to a Grouper provisioning entity.com.fasterxml.jackson.databind.node.ObjectNodetoSetAdminPermissionsJson(List<String> roleIds) Build the request body for POST /2/team/members/set_admin_permissions_v2.com.fasterxml.jackson.databind.node.ObjectNodetoSetProfileJson(Set<String> fieldNamesToSet) Build the request body for POST /2/team/members/set_profile_v2.toString()com.fasterxml.jackson.databind.node.ObjectNodeBuild a UserSelectorArg union selecting this member by team_member_id.
-
Field Details
-
STATUS_ACTIVE
member status: active member of the team- See Also:
-
STATUS_INVITED
member status: invited but not yet joined- See Also:
-
STATUS_SUSPENDED
member status: suspended (deprovisioned but account retained)- See Also:
-
STATUS_REMOVED
member status: removed from the team- See Also:
-
LIFECYCLE_STATE_ACTIVE
lifecycle state: a normal active team member (default)- See Also:
-
LIFECYCLE_STATE_SUSPENDED
lifecycle state: suspended (deactivated, account retained on the team)- See Also:
-
LIFECYCLE_MARKER_SUSPENDED
lifecycle marker group extension that suspends the member (under the lifecycle folder)- See Also:
-
LIFECYCLE_MARKER_DOWNGRADE
lifecycle marker group extension that, on deprovision, converts the member to a free Basic account (keep_account=true) instead of deleting it (under the lifecycle folder)- See Also:
-
ADMIN_ROLE_HIERARCHY
The 8 built-in Dropbox admin roles, ordered highest-privilege first. When a member belongs to more than one admin-role group, full sync resolves to the highest tier in this list. A member in no admin-role group is member_only (a regular member with no admin rights). These names match the group extension under the configured admin-role folder.
-
-
Constructor Details
-
DropboxUser
public DropboxUser()
-
-
Method Details
-
highestAdminRole
Resolve the highest-privilege admin role among a set of role names, per ADMIN_ROLE_HIERARCHY. Returns null if the set is empty or contains no known role.- Parameters:
roleNames- candidate admin role names- Returns:
- the highest-tier role name, or null
-
createTableDropboxUser
Create the mock database table that simulates the Dropbox member store for tests.- Parameters:
ddlVersionBean- ddl version beandatabase- the database model
-
getId
-
setId
-
getEmail
-
setEmail
-
getExternalId
-
setExternalId
-
getGivenName
-
setGivenName
-
getSurname
-
setSurname
-
getStatus
-
setStatus
-
getAccountId
-
setAccountId
-
getAdminRole
-
setAdminRole
-
getLifecycleState
-
setLifecycleState
-
isLifecycleSuspended
public boolean isLifecycleSuspended()- Returns:
- true if the desired lifecycle state is suspended
-
isActive
public boolean isActive()- Returns:
- true if the member is active on the team
-
toString
-
fromJson
Convert from a Dropbox member profile JSON node. Accepts either a bare TeamMemberProfile or a member_info wrapper containing a "profile" object.- Parameters:
memberNode- a Dropbox member JSON object- Returns:
- the DropboxUser, or null if memberNode is null
-
toAddJson
public com.fasterxml.jackson.databind.node.ObjectNode toAddJson()Build the member entry for POST /2/team/members/add_v2 (new_members array element).- Returns:
- the new-member request object
-
toSetProfileJson
Build the request body for POST /2/team/members/set_profile_v2. The member is selected by team_member_id; only the supplied new_* fields are changed.- Parameters:
fieldNamesToSet- field names to set, or null for all- Returns:
- the set_profile request body
-
toUserSelectorJson
public com.fasterxml.jackson.databind.node.ObjectNode toUserSelectorJson()Build a UserSelectorArg union selecting this member by team_member_id.- Returns:
- the user selector JSON
-
toSetAdminPermissionsJson
public com.fasterxml.jackson.databind.node.ObjectNode toSetAdminPermissionsJson(List<String> roleIds) Build the request body for POST /2/team/members/set_admin_permissions_v2. The member is selected by team_member_id. new_roles holds the resolved Dropbox role ids; an empty list demotes the member to member_only (no admin rights).- Parameters:
roleIds- the Dropbox role ids to assign (empty for member_only)- Returns:
- the set_admin_permissions request body
-
toProvisioningEntity
Convert to a Grouper provisioning entity. The provisioning entity id is the native team_member_id; matching is configured on the externalId attribute.- Returns:
- the converted target entity
-
fromProvisioningEntity
public static DropboxUser fromProvisioningEntity(ProvisioningEntity targetEntity, Set<String> fieldNamesToSet) Convert from a Grouper provisioning entity to a DropboxUser.- Parameters:
targetEntity- the Grouper provisioning entityfieldNamesToSet- field names to set, or null for all- Returns:
- the DropboxUser
-