共用方式為


IAcl.CheckPermission(IPrincipal, IPermission) Method

Definition

Checks whether or not the specified principal has the specified permission.

[Android.Runtime.Register("checkPermission", "(Ljava/security/Principal;Ljava/security/acl/Permission;)Z", "GetCheckPermission_Ljava_security_Principal_Ljava_security_acl_Permission_Handler:Java.Security.Acl.IAclInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool CheckPermission (Java.Security.IPrincipal? principal, Java.Security.Acl.IPermission? permission);
[<Android.Runtime.Register("checkPermission", "(Ljava/security/Principal;Ljava/security/acl/Permission;)Z", "GetCheckPermission_Ljava_security_Principal_Ljava_security_acl_Permission_Handler:Java.Security.Acl.IAclInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CheckPermission : Java.Security.IPrincipal * Java.Security.Acl.IPermission -> bool

Parameters

principal
IPrincipal

the principal, assumed to be a valid authenticated Principal.

permission
IPermission

the permission to be checked for.

Returns

true if the principal has the specified permission, false otherwise.

Attributes

Remarks

Checks whether or not the specified principal has the specified permission. If it does, true is returned, otherwise false is returned.

More specifically, this method checks whether the passed permission is a member of the allowed permission set of the specified principal. The allowed permission set is determined by the same algorithm as is used by the getPermissions method.

Java documentation for java.security.acl.Acl.checkPermission(java.security.Principal, java.security.acl.Permission).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also