3.1.5.58 proc_SecCloneRoleDefinitions

The proc_SecCloneRoleDefinitions stored procedure creates a copy of the current role definition for a site (2). After successful execution, the site (2) will have its own copy of the role definition and unique role assignments, and the site (2) and all subsites that inherit permissions will use the new role definition.

 PROCEDURE proc_SecCloneRoleDefinitions(
       @SiteId                        uniqueidentifier,
       @WebId                         uniqueidentifier,
       @CopyRoleAssignments           bit,
       @UserId                        int,
       @NewScopeId                    uniqueidentifier OUTPUT,
       @RequestGuid                   uniqueidentifier = NULL OUTPUT
 );

@SiteId: The site collection identifier of the site collection containing the site (2).

@WebId: The site identifier of the site (2) which will have its current role definition copied.

@CopyRoleAssignments: Specifies whether to keep the current role assignments. If this parameter is set to 1, the current role assignments will kept. If this parameter is set to 0, then the user specified by @UserId will be added to the Administrator Role, and everyone else will be removed from all roles. @CopyRoleAssignments MUST NOT be NULL.

@UserId: The user identifier of the current user. @UserId is assigned to the administrator role when @CopyRoleAssignments is set to 0. This value MUST refer to an existing user identifier for the specified site collection.

@NewScopeId: An output parameter which contains a scope identifier for the security scope of the site (2). If the site (2) already has unique role assignments before this call, then a new security scope MUST NOT be generated, and the output parameter MUST be the original scope identifier of the site. If the site (2) does not have unique role assignments before this call, then a new security scope MUST be generated for this site, and the scope identifier of the new security scope MUST be returned in the output parameter.

@RequestGuid: The optional request identifier for the current request.

Return Values: The proc_SecCloneRoleDefinitions stored procedure returns an integer return code, which MUST be listed in the following table.

Value

Description

0

Successful execution.

3

The site (2) was not found. Either the site (2) specified by @SiteId/@WebId does not exist, or the site already has its own role definition.

80

The site (2) has a role definition with the same title as one of the role definitions that will be cloned.

The proc_SecCloneRoleDefinitions stored procedure MUST return either one or two result sets on successful execution, both of which used the same result set definition.