Share via


PermissionCollection Class

The PermissionCollection class represents a collection of Permission objects.

System.Object

   Microsoft.SharePoint.Portal.Security.PermissionCollection

Public Methods

The following table shows the methods of the PermissionCollection class and a brief description of each.

Name Description
Add(Microsoft.SharePoint.Portal.Security.IMember, Microsoft.SharePoint.Portal.Security.PortalRight) Adds a Permission object with the specified member and rights to the collection.
Add(Microsoft.SharePoint.SPMember, Microsoft.SharePoint.Portal.Security.PortalRight) Adds a Permission object with the specified member and rights to the collection. This method takes an SPMember object, which is writable.
AddUser(String, String, String, String, Microsoft.SharePoint.Portal.Security.PortalRight) Adds a user with the specified rights.
GetEnumerator() Gets the enumerator that enables you to traverse the PermissionCollection object.
Remove(Microsoft.SharePoint.Portal.Security.IMember) Removes the permission associated with the specified member from the collection.
Remove(Microsoft.SharePoint.SPMember) Removes the permission associated with the specified member from the collection. This method takes the SPMember object, which is writable.

Public Properties

The following table shows the properties of the PermissionCollection class, the data type of each property, and a brief description of each.

Name Data type Description
AnonymousState Microsoft.SharePoint.Portal.Security.PortalAnonymousState Gets or sets the level of access for anonymous users in an area or site.
Count Int32 Gets the number of permissions in the collection.
Inherited Boolean Gets a Boolean value that specifies whether the site or area inherits the permissions from its parent.
Item(Int32) Microsoft.SharePoint.Portal.Security.Permission Gets the Permission object at the specified index in the collection.
Item(Microsoft.SharePoint.Portal.Security.IMember) Microsoft.SharePoint.Portal.Security.Permission Gets the Permission object for the specified member object in the collection.
Item(Microsoft.SharePoint.SPMember) Microsoft.SharePoint.Portal.Security.Permission Gets the Permission object for the specified member object in the collection. This property takes the SPMember object, which is writable.
SiteAnonymousState Microsoft.SharePoint.Portal.Security.PortalAnonymousState Gets the level of access for anonymous users on the top-level site.

Example

The following example shows how to browse through the PermissionCollection object for the portal site.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Requirements

Namespace: Microsoft.SharePoint.Portal.Security

Platforms: Microsoft Windows Server 2003

Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Security: Code Access Security