Språk

Policy.GetPermissions Method

Definition

Overloads

GetPermissions(CodeSource)

[Android.Runtime.Register("getPermissions", "(Ljava/security/CodeSource;)Ljava/security/PermissionCollection;", "GetGetPermissions_Ljava_security_CodeSource_Handler")]
public virtual Java.Security.PermissionCollection? GetPermissions(Java.Security.CodeSource? codesource);
[<Android.Runtime.Register("getPermissions", "(Ljava/security/CodeSource;)Ljava/security/PermissionCollection;", "GetGetPermissions_Ljava_security_CodeSource_Handler")>]
abstract member GetPermissions : Java.Security.CodeSource -> Java.Security.PermissionCollection
override this.GetPermissions : Java.Security.CodeSource -> Java.Security.PermissionCollection

Parameters

codesource
CodeSource

the CodeSource to which the returned PermissionCollection has been granted.

Returns

a set of permissions granted to the specified CodeSource. If this operation is supported, the returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types. If this operation is not supported, Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.

Attributes

Remarks

Return a PermissionCollection object containing the set of permissions granted to the specified CodeSource. Applications are discouraged from calling this method since this operation may not be supported by all policy implementations. Applications should solely rely on the implies method to perform policy checks. If an application absolutely must call a getPermissions method, it should call getPermissions(ProtectionDomain). The default implementation of this method returns Policy.UNSUPPORTED_EMPTY_COLLECTION. This method can be overridden if the policy implementation can return a set of permissions granted to a CodeSource.

Java reference for java.security.Policy.getPermissions.

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

GetPermissions(ProtectionDomain)

[Android.Runtime.Register("getPermissions", "(Ljava/security/ProtectionDomain;)Ljava/security/PermissionCollection;", "GetGetPermissions_Ljava_security_ProtectionDomain_Handler")]
public virtual Java.Security.PermissionCollection? GetPermissions(Java.Security.ProtectionDomain? domain);
[<Android.Runtime.Register("getPermissions", "(Ljava/security/ProtectionDomain;)Ljava/security/PermissionCollection;", "GetGetPermissions_Ljava_security_ProtectionDomain_Handler")>]
abstract member GetPermissions : Java.Security.ProtectionDomain -> Java.Security.PermissionCollection
override this.GetPermissions : Java.Security.ProtectionDomain -> Java.Security.PermissionCollection

Parameters

domain
ProtectionDomain

the ProtectionDomain to which the returned PermissionCollection has been granted.

Returns

a set of permissions granted to the specified ProtectionDomain. If this operation is supported, the returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types. If this operation is not supported, Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.

Attributes

Remarks

Return a PermissionCollection object containing the set of permissions granted to the specified ProtectionDomain. Applications are discouraged from calling this method since this operation may not be supported by all policy implementations. Applications should rely on the implies method to perform policy checks. The default implementation of this method first retrieves the permissions returned via getPermissions(CodeSource) (the CodeSource is taken from the specified ProtectionDomain), as well as the permissions located inside the specified ProtectionDomain. All of these permissions are then combined and returned in a new PermissionCollection object. If getPermissions(CodeSource) returns Policy.UNSUPPORTED_EMPTY_COLLECTION, then this method returns the permissions contained inside the specified ProtectionDomain in a new PermissionCollection object. This method can be overridden if the policy implementation supports returning a set of permissions granted to a ProtectionDomain.

Java reference for java.security.Policy.getPermissions.

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