Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IRole.SetAccessLevel Method

Sets access level for a given object type.

void SetAccessLevel(
FunctionalAreas objectType,
AccessLevels accessLevel
);

#### Parameters

objectType
  The object type, cannot be `null`.
accessLevel
  The access level, cannot be `null`.

#### Remarks

Note that modifying the access level will not be stored permanently nor be invalidated until `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 area within a project; to set the default project access level, please use `IProject.SetAccessLevel` method. Below sample code shows how to modify the access level for a functional area.

    //retrieve the member role of the project
    IRole memberRole = project.GetRole(RoleTypes.Member);

    //change the member role to have Admin access level for Document functional area
    role.SetAccessLevel(FunctionalAreas.Document, AccessLevels.Adim);

    //need to store the role to persist the access level change
    role.Store();

#### Exceptions

Exception Type | Condition
--- | ---
CollaborationException | This role is a `LEADER` role.

#### See Also

IRole Interface | Plumtree.Remote.PRC.Collaboration.Security Namespace