Set task list access level for a given role type.
null
. null
. The task list must have its default security disabled prior to this call using }DefaultSecurity=false
. Any security change on the task list will be automatically applied to all tasks in this task list after Store
is called. Trying to modify the access level for a Leader role type will throw CollaborationException
upon Store
.
//verify if the current user has the permission to edit security for the discussion
bool hasPermission = discussion.IsActionAllowed(DiscussionPermissions.EditSecurity);
//after making sure the current user has permission to edit security, modify the access level
if (hasPermission)
{
//first disable using project default security
discussion.DefaultSecurity = false;
//then change discussion to have the READ access level for member role type
discussion.SetAccessLevel(RoleTypes.Member, AccessLevels.Read);
//need to store the discussion to persist the access level change
discussion.Store();
}
Exception Type | Condition |
---|---|
InvalidOperationException | Project default security is used (call setDefaultSecurity(false) prior to modifying the object access level). |
ITaskList Interface | Plumtree.Remote.PRC.Collaboration.Tasklist Namespace