|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that represents a project role that specifies
which groups and users can access the objects in this project.
Users, groups and communities can be added to and removed from a role.
Note: Adding a non-existent user, group or community ID will
succeed until the role has been updated and stored permanently
via the store
method, at which time the role instance
will get refreshed. All other modifications also require
the store
method to be called.
Method Summary | |
void |
addCommunityMember(int communityID,
CommunityMemberType memberType)
Adds a community member type to a role. |
void |
addMember(int memberID,
MemberType memberType)
Adds a member to a role. |
AccessLevel |
getAccessLevel(FunctionalArea objectType)
Returns the access level for the given object type. |
IProject |
getBelongingProject()
Returns an IProject object representing the project that this role belongs to. |
java.lang.String |
getDescription()
Returns the object description for the role. |
int |
getID()
Returns the object ID for the role. |
int[] |
getMemberIDs(MemberQueryType memberType)
Returns the IDs of members who belong to this role based on the given member type. |
java.lang.String |
getName()
Returns the object name for the role. |
RoleType |
getRoleType()
Returns the type of role this object represents. |
void |
removeCommunityMember(int communityID,
CommunityMemberType memberType)
Removes a community member type from a role. |
void |
removeMember(int memberID,
MemberType memberType)
Removes a member from a role. |
void |
setAccessLevel(FunctionalArea objectType,
AccessLevel accessLevel)
Sets the access level for the given object type. |
void |
store()
Refreshes the access levels and members contained in this role instance. |
Method Detail |
public void addCommunityMember(int communityID, CommunityMemberType memberType)
store
method, at which time the role instance will get refreshed.
communityID
- the community ID the user to be added belongs to; must be positivememberType
- the member type of the user in the community; cannot be null
java.lang.IllegalArgumentException
- if the community ID is not positivepublic void addMember(int memberID, MemberType memberType)
store
method, at which time the role instance will get refreshed.
getMemberIDs
with
MemberQueryType.ALL_USERS
.
However, for users belonging to a group that is then added to a role,
IDs of individual users in the group will NOT
be retrievable using getMemberIDs
with
MemberQueryType.All_USERS
.
Instead, MemberQueryType.All_GROUPS
should be
used to retrieve the group ID.
memberID
- the ID of the member to be added to role; can be a portal
user or a portal user group. Must be positive.memberType
- the type of member to be added; cannot be null
java.lang.IllegalArgumentException
- if the member ID is not positivepublic AccessLevel getAccessLevel(FunctionalArea objectType)
objectType
- the object type; cannot be null
public IProject getBelongingProject() throws CollaborationException, java.rmi.RemoteException
IProject
object representing the project that this role belongs to.
CollaborationException
- if the method call resulted in an error
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic java.lang.String getDescription()
public int getID()
public int[] getMemberIDs(MemberQueryType memberType) throws CollaborationException, java.rmi.RemoteException
addMember
with MemberType.USER
,
or groups that are added to a role using
addMember
with MemberType.GROUP
.
MemberQueryType.ALL_USER
.
However, for users belonging to a group that is then added to a role as a group member type,
IDs of individual users in the group will NOT
be retrievable using getMemberIDs
with
MemberQueryType.ALL_USER
.
Instead, MemberQueryType.All_GROUPS
should be
used to retrieve the group ID.
memberType
- the type of members to retrieve from this role; cannot be null
CollaborationException
- if the method call resulted in an error
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method callpublic java.lang.String getName()
public RoleType getRoleType()
public void removeCommunityMember(int communityID, CommunityMemberType memberType)
communityID
- the community ID the member to be removed belongs to; must be positivememberType
- the member type of the user in the community; cannot be null
java.lang.IllegalArgumentException
- if the community ID is not positivepublic void removeMember(int memberID, MemberType memberType)
memberID
- the ID of the member to be removed from the role; can be a
portal user, or a portal user group. Must be positive.memberType
- the type of member to be removed; cannot be null
java.lang.IllegalArgumentException
- if the member ID is not positivepublic void setAccessLevel(FunctionalArea objectType, AccessLevel accessLevel) throws CollaborationException
store
method is called.
This method cannot be called on a leader role, since the access level of
a LEADER
role cannot be modified.
This method is for setting access level for individual
functional areas within a project; to set the default
project access level, use IProject.setAccessLevel
method.
//sample code - how to modify the access level for a functional area. //retrieve the member role of the project IRole memberRole = project.getRole(RoleType.MEMBER); //change the member role to have ADMIN access level for DOCUMENT functional area role.setAccessLevel(FunctionalArea.DOCUMENT, AccessLevel.ADMIN); //need to store the role to persist the access level change role.store();
objectType
- the object type; cannot be null
accessLevel
- the access level; cannot be null
CollaborationException
- if this role is a LEADER
rolepublic void store() throws CollaborationException, java.rmi.RemoteException
IRole
will not
be stored permanently until this method is called.
CollaborationException
- if anu invalid IDs were
added to the role with addMember
prior to this call. Includes a detailed message denoting all the invalid IDs.
java.rmi.RemoteException
- if there was a communication problem during the execution of the remote method call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.