Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets the role definition for the web group with the specified ID from the specified collection of role definitions.
Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function GetRoleDefinitionFromLegacyWebGroupId ( _
    roles As SPRoleDefinitionCollection, _
    webGroupId As Integer _
) As SPRoleDefinition
'Usage
Dim roles As SPRoleDefinitionCollection
Dim webGroupId As Integer
Dim returnValue As SPRoleDefinition
returnValue = SPUtility.GetRoleDefinitionFromLegacyWebGroupId(roles, _
    webGroupId)
public static SPRoleDefinition GetRoleDefinitionFromLegacyWebGroupId(
    SPRoleDefinitionCollection roles,
    int webGroupId
)
Parameters
roles
Type: Microsoft.SharePoint.SPRoleDefinitionCollectionThe collection of role definitions.
webGroupId
Type: System.Int32The web group ID to get the role definition.
Return Value
Type: Microsoft.SharePoint.SPRoleDefinition
The role definition for the web group.
Exceptions
| Exception | Condition | 
|---|---|
| ArgumentException | The role definition cannot be found for the web group.  | 
Remarks
This method gets the role definition for the web group with the ID specified by the webGroupId parameter from the role definition collection specified by the roles parameter.