--- myst: substitutions: ico_method: |- ```{image} /img/code_reference/net_library/method.ico :width: 15px ``` ico_prop: |- ```{image} /img/code_reference/net_library/prop.ico :width: 15px ``` --- # RoleObject Class **Namespace:** bcpDevKit.Entities.Configuration\ **Assembly:** bcpDevKit.dll ## Syntax ```csharp public class RoleObject ``` ## Properties | Type | Name | Description | |-------------------------------------------------------------|------|------------------------------------| | {{ico_prop}} string | Name | Gets or sets the name of the role. | | {{ico_prop}} string | Name | Gets or sets the role description. | | {{ico_prop}} IEnumerable\<[Permission]()> | Name | Gets all the roles permissions. | ## Methods | Type | Name | Description | |--------------------------------------------------|------|-----------------------------------------------------------------------------------------| | {{ico_method}} [Permission]() | Name | Creates and adds a new permission to the role if no one with the specified name exists. | | {{ico_method}} [Permission]() | Name | Retrieves the permission with the specified name if exists. | ## Remarks ## Examples **Assign user to specific role and add permissions:** ```csharp var security = bcpService.EntitiesTable.Vault.Security; var user = security.AddUser("Kim"); user.AddRole("Document Manager (Level 1)"); var role = security.GetRole("Document Manager (Level 1)") role.AddPermission("FileChangeCategory"); role.AddPermission("FileChangeRevision"); ```