Share via


SPRoleDefinition.Update Method

Updates the role definition with changes that have been made to its properties.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableExceptionConstraintAttribute(FixedId := "System.UnauthorizedAccessException$E_ACCESSDENIED",  _
    ErrorType := GetType(UnauthorizedAccessException), Condition := "Current user does not have sufficient permissions to update the role definition")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "System.ArgumentException$0", ErrorType := GetType(ArgumentException),  _
    Condition := "Role definition is not part of a collection or site")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "System.InvalidOperationException$0",  _
    ErrorType := GetType(InvalidOperationException), Condition := "Role definition is inherited from a parent site")> _
<ClientCallableExceptionConstraintAttribute(FixedId := "SPException$TP_E_NEED_UNIQUEPERM", ErrorType := GetType(SPException),  _
    Condition := "Role definition is not unique to current site",  _
    ErrorCode := )> _
<ClientCallableExceptionConstraintAttribute(FixedId := "SPException$TP_E_BADGROUPNAME", ErrorType := GetType(SPException),  _
    Condition := "Invalid role definition name, either empty or contains one or more invalid characters",  _
    ErrorCode := )> _
<ClientCallableExceptionConstraintAttribute(FixedId := "SPException$TP_E_GROUPALREADYEXISTS",  _
    ErrorType := GetType(SPException), Condition := "Specified role definition has conflicting properties with existing roles",  _
    ErrorCode := )> _
<ClientCallableAttribute> _
Public Sub Update
'Usage
Dim instance As SPRoleDefinition

instance.Update()
[ClientCallableExceptionConstraintAttribute(FixedId = "System.UnauthorizedAccessException$E_ACCESSDENIED", 
    ErrorType = typeof(UnauthorizedAccessException), Condition = "Current user does not have sufficient permissions to update the role definition")]
[ClientCallableExceptionConstraintAttribute(FixedId = "System.ArgumentException$0", ErrorType = typeof(ArgumentException), 
    Condition = "Role definition is not part of a collection or site")]
[ClientCallableExceptionConstraintAttribute(FixedId = "System.InvalidOperationException$0", ErrorType = typeof(InvalidOperationException), 
    Condition = "Role definition is inherited from a parent site")]
[ClientCallableExceptionConstraintAttribute(FixedId = "SPException$TP_E_NEED_UNIQUEPERM", ErrorType = typeof(SPException), 
    Condition = "Role definition is not unique to current site", 
    ErrorCode = )]
[ClientCallableExceptionConstraintAttribute(FixedId = "SPException$TP_E_BADGROUPNAME", ErrorType = typeof(SPException), 
    Condition = "Invalid role definition name, either empty or contains one or more invalid characters", 
    ErrorCode = )]
[ClientCallableExceptionConstraintAttribute(FixedId = "SPException$TP_E_GROUPALREADYEXISTS", 
    ErrorType = typeof(SPException), Condition = "Specified role definition has conflicting properties with existing roles", 
    ErrorCode = )]
[ClientCallableAttribute]
public void Update()

Exceptions

Exception Condition
ArgumentException

The ParentWeb property is null .

InvalidOperationException

The role definitions of the ParentWeb property are inherited from a parent website.

Remarks

You can only call the Update method on an SPRoleDefinition object within an SPRoleDefinitionCollection that is bound to a Microsoft SharePoint Foundation object that implements the ISecurableObject interface (for example,Microsoft.SharePoint.SPWeb).

See Also

Reference

SPRoleDefinition Class

SPRoleDefinition Members

Microsoft.SharePoint Namespace