UserPermissionCollection.Item[] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Item[Int32] |
Gets the UserPermission object at the specified index in the collection. |
Item[String] |
Get the UserPermission object with the specified UserId from the collection. |
Item[Int32]
Gets the UserPermission object at the specified index in the collection.
public:
abstract property Microsoft::Office::InfoPath::UserPermission ^ default[int] { Microsoft::Office::InfoPath::UserPermission ^ get(int index); };
public abstract Microsoft.Office.InfoPath.UserPermission this[int index] { get; }
member this.Item(int) : Microsoft.Office.InfoPath.UserPermission
Default Public MustOverride ReadOnly Property Item(index As Integer) As UserPermission
Parameters
- index
- Int32
The zero-based index of the UserPermission object to retrieve.
Property Value
A UserPermission object that represents the specified user.
Examples
In the following example, clicking the Button control gets the UserPermissionsCollection for the current form and sets the second user in the collection to the Change access level.
public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
Permission.UserPermissions[1].Permission = PermissionType.Change;
}
Public Sub CTRL1_Clicked(ByVal sender As Object, _
ByVal e As ClickedEventArgs)
Permission.UserPermissions(1).Permission = PermissionType.Change
End Sub
Remarks
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.
Applies to
Item[String]
Get the UserPermission object with the specified UserId from the collection.
public:
abstract property Microsoft::Office::InfoPath::UserPermission ^ default[System::String ^] { Microsoft::Office::InfoPath::UserPermission ^ get(System::String ^ userId); };
public abstract Microsoft.Office.InfoPath.UserPermission this[string userId] { get; }
member this.Item(string) : Microsoft.Office.InfoPath.UserPermission
Default Public MustOverride ReadOnly Property Item(userId As String) As UserPermission
Parameters
- userId
- String
The e-mail address of the specified user.
Property Value
A UserPermission that represents the specified user. Returns a null reference (Nothing in Visual Basic) if the specified userId
does not exist.
Examples
In the following example, clicking the Button control gets the UserPermissionsCollection for the current form and sets the user with the e-mail address someone@example.com to the Change access level.
public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
Permission.UserPermissions["someone@example.com"].Permission =
PermissionType.Change;
}
Public Sub CTRL1_Clicked(ByVal sender As Object, _
ByVal e As ClickedEventArgs)
Permission.UserPermissions("someone@example.com").Permission = _
PermissionType.Change
End Sub
Remarks
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.