SPPermissionCollection.RequestAccessEmail Property
NOTE: This API is now obsolete.
Gets or sets whether request for access is enabled for a site and specifies the e-mail address to which requests are sent.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
<ObsoleteAttribute("Use the SPRoleAssignmentCollection class instead")> _
Public Property RequestAccessEmail As String
Get
Set
'Usage
Dim instance As SPPermissionCollection
Dim value As String
value = instance.RequestAccessEmail
instance.RequestAccessEmail = value
[ObsoleteAttribute("Use the SPRoleAssignmentCollection class instead")]
public string RequestAccessEmail { get; set; }
Property Value
Type: System.String
A string that contains the e-mail address. If set to an empty string, request for access to the site is not enabled.
Remarks
The RequestAccessEmail property applies to the permissions for an entire site; the RequestAccess property applies to the permissions for a single list. If the RequestAccessEmail property contains an empty string, request for access is not enabled for the site or for any of its lists.
Examples
The following code example enables request for access on the current site, but removes request for access from a specified list.
Dim site As SPWeb = SPContext.Current.Web
Dim permsSite As SPPermissionCollection = site.Permissions
permsSite.RequestAccessEmail = "Email_Address"
Dim lists As SPListCollection = site.Lists
Dim permsList As SPPermissionCollection =
lists("List_Title").Permissions
permsList.RequestAccess = False
SPWeb oWebsite = SPContext.Current.Web;
SPPermissionCollection collPermissions = oWebsite.Permissions;
collPermissions.RequestAccessEmail = "Email_Address";
SPListCollection collLists = oWebsite.Lists;
SPPermissionCollection collPermissions = collLists["List_Title"].Permissions;
collPermissions.RequestAccess = false;