3.1.5.110 proc_SecRemoveUserFromScopeByLogin

The proc_SecRemoveUserFromScopeByLogin stored procedure is invoked to remove a user, specified by login name, from a role in a specified security scope. If no role is specified, or if the role specified is the "Guest" Role, then the user will be removed from all roles in the specified scope and will also be removed from other scopes associated with the specified site.

 PROCEDURE proc_SecRemoveUserFromScopeByLogin(
       @SiteId                        uniqueidentifier,
       @WebId                         uniqueidentifier,
       @WebScopeId                    uniqueidentifier,
       @ScopeId                       uniqueidentifier,
       @RemoveFromCurrentScopeOnly    bit,
       @LoginName                     nvarchar(255),
       @RoleId                        int                = NULL,
       @RequestGuid                   uniqueidentifier   = NULL OUTPUT
 );

@SiteId: The site collection identifier (section 2.2.1.9) of the site collection containing the user and scope.

@WebId: The site identifier (section 2.2.1.11) of the site using the role.

@WebScopeId: The scope identifier (section 2.2.1.8) of the scope which includes the site specified by @WebId. If @RoleId is not NULL and is not the role identifier of the "Guest" Role (1073741825), then @WebScopeId MUST be ignored. Otherwise, @WebScopeId determines which additional scopes the user MUST be removed from, as follows:

  • If @WebScopeId is equal to @ScopeId, remove the specified user from all scopes associated with all sites sharing the permissions of the site specified by @WebId.

  • If @WebScopeId is not equal to @ScopeId, remove the specified user from all scopes associated with the site specified by @WebId.

@ScopeId: The scope identifier of the scope in the site collection from which to remove the user. See @WebScopeId for conditions of equality between @ScopeId and @WebScopeId.

@RemoveFromCurrentScopeOnly: The bit flag indicating from which scope the user SHOULD be removed. If this flag is set to 1, then proc_SecRemoveUserFromScopeByLogin MUST remove the user from the current scope only.

@LoginName: The login name of the user.

@RoleId: The role identifier to remove from the specified scopes. @RoleId MUST be NULL or correspond to a valid role. If @RoleId is NULL, or is the role identifier of the Guest role (1073741825), then proc_SecRemoveUserFromScopeByLogin MUST remove the user corresponding to @LoginName from all roles.

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

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

Value

Description

0

Successful execution.

1317

UserId not found for site collection or login name.

The proc_SecRemoveUserFromScopeByLogin stored procedure MUST return a single result set as follows.