AddRole(Microsoft.SharePoint.Portal.PortalContext, String, String, Microsoft.SharePoint.Portal.Security.PortalRight) Method

The AddRole method of the SecurityManager class adds a role to a portal site with the specified title, description, and rights.


ctx A Microsoft.SharePoint.Portal.PortalContext value that represents the portal site.

title The title for the role.

description The description of the role.

rights A Microsoft.SharePoint.Portal.Security.PortalRight value that represents the rights for the role.


You need to have the ManageAreaSecurity right on the root area to call this method.

Return Value

The Microsoft.SharePoint.Portal.Security.Role object that represents the role added to the portal site.


The following example shows how to add a role to a portal site.


Platforms: Microsoft Windows Server 2003

Security: Code Access Security