del método SPPermissionCollection.Add
NOTA: esta API está ahora obsoleta.
Crea un objeto de permiso con el miembro especificado y permisos de la colección.
Espacio de nombres: Microsoft.SharePoint
Ensamblado: Microsoft.SharePoint (en Microsoft.SharePoint.dll)
Sintaxis
'Declaración
<ObsoleteAttribute("Use the SPRoleAssignmentCollection class instead")> _
Public Sub Add ( _
member As SPMember, _
permissionMask As SPRights _
)
'Uso
Dim instance As SPPermissionCollection
Dim member As SPMember
Dim permissionMask As SPRights
instance.Add(member, permissionMask)
[ObsoleteAttribute("Use the SPRoleAssignmentCollection class instead")]
public void Add(
SPMember member,
SPRights permissionMask
)
Parámetros
member
Tipo: Microsoft.SharePoint.SPMemberUn objeto Member que representa al elemento.
permissionMask
Tipo: Microsoft.SharePoint.SPRightsUn valor de SPRights que especifica los permisos.
Ejemplos
En el ejemplo de código siguiente se modifica los permisos de un grupo de la lista anuncios del sitio actual.
Dim site As SPWeb = SPContext.Current.Web
Dim destList As SPList = site.Lists("Announcements")
Dim destPermissions As SPPermissionCollection = destList.Permissions
Dim member As SPMember = site.SiteGroups("Group_Name")
destPermissions.Add(member, SPRights.EditListItems Or
SPRights.ViewListItems)
SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["Announcements"];
SPPermissionCollection collPermissions = oList.Permissions;
SPMember oMember = oWebsite.SiteGroups["Group_Name"];
collPermissions.Add(oMember, SPRights.EditListItems |
SPRights.ViewListItems);