Parameters
- id
- Optional ID for the new Role object.
Return Value
A new Role object that is set to be the currently active role.
Create and return a new Role object with the ID id, add it to the Role collection and then mark it as the active role without applying its General settings changes to the system.
If id is not provided, a GUID will be used for the role's ID.
| Exception | Description |
|---|---|
| WrNonUniqueIdException | A WrNonUniqueIdException will be thrown if attempting to create a new Role with an ID that already exists in the RoleCollection. |
Role mySessionRole = api.Roles.NewRole(); //make changes to the Role's properties here mySessionRole.Activate(true);