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.
This example describes the requests made when a user is added to a site group using SharePoint Object Model code running on the WFE.
Figure 3: Group Add User To Site Group OM
This scenario is initiated by a call to the object model command SPGroup.Users.Add(). For simplicity's sake, this example assumes that:
The code has already instantiated the site collection (SPSite), Web (SPWeb), and Group (SPGroup) objects, which contain the site group for this session.
The instantiated objects have not yet populated information about the user information list.
The user to be added to the group is currently a user in the site collection.
The following actions happen:
The WFE first fetches the properties for the "User Information List" of the target site collection, a SharePoint list that contains information about users and groups (2) registered in a site collection. It does this by calling the stored procedure proc_GetListMetaDataAndEventReceivers (section 3.1.5.33) using TDS.
The BEDS returns two result sets, which include the List Metadata (section 2.2.4.14) and Event Receivers (section 2.2.4.11) for the specified user information list.
The WFE determines the site map for the site collection by calling the configuration database stored procedure proc_getSiteMapById (section 3.1.5.39) using TDS.
The BEDS returns a single Site Map By Id Result Set (section 3.1.5.39.1), which includes the site map for the specified site collection.
If the WFE determines that the user information list has not been populated in the current SPSite object, it requests the list field information for the site collection's user information list by calling the proc_GetListFields (section 3.1.5.32) stored procedure using TDS.
The BEDS returns a single Fields Information Result Set (section 3.1.5.32.1), which includes the field information for the specified user information list.
If the WFE determines that it needs to populate the list of SPFeatures, the list of child objects that inherit from the base class SPFeatureDefinition will be populated by calling the configuration database stored procedure proc_getObjectsByBaseClass (section 3.1.5.35) using TDS.
The BEDS returns a single Object ID Result Set (section 2.2.4.18), which includes a list of child object identifiers for the specified base class and parent object.
The WFE builds a transactional dynamic SQL query to add the user to the site collection and add the user's property information to the user information list. This query is sent to the SQL server using TDS. On the SQL server the following actions occur:
The query begins a new SQL transaction.
The query attempts to add the user to the site collection using the stored procedure proc_SecAddUser (section 3.1.5.51).
The query checks if the user exists in the site collection's user information list.
If the user is not found in the site collection's user information list, the query attempts to add the user's properties to the site collection's user information list using the stored procedure proc_AddListItem (section 3.1.5.4).
The query rolls back the SQL transaction if the previous procedures were not successful, or it commits the transaction if they were successful.
The BEDS returns a single result set indicating the status of the actions within the query and the output parameters from the proc_SecAddUser command.
The WFE queries the list of users in the user information list for the site collection by building a SQL Batch call to the UserData View (section 2.2.6.8), which is then sent to the SQL server using TDS.
The BEDS returns a single result set with a list of items in the UserData View.
The WFE builds a transactional dynamic SQL query to add or update the list item that represents the user with the user's properties. This query is sent to the SQL server using TDS. On the SQL server the following actions occur:
The query begins a new SQL transaction.
The query checks if the user exists in the user information list for the site collection.
If the user is not found in the user information list for the site collection, then the query attempts to add the user's properties to the site collection's user information list using the stored procedure proc_AddListItem.
Otherwise, if the user is found in the site collection's user information list, the query attempts to update the user's properties in the site collection's user information list using the stored procedure proc_UpdateListItem (section 3.1.5.127).
The query rolls back the SQL transaction if the previous procedures were not successful, or it commits the transaction if they were successful.
The BEDS returns two result sets, which contain the output and return codes from the Add List Item or Update List Item commands.
The WFE adds the user to the specified site group by calling the stored procedure proc_SecAddUserToSiteGroup (section 3.1.5.52) using TDS.
The BEDS supplies a return code indicating success or failure of the procedure.