Subject.DoAsPrivileged Method
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
DoAsPrivileged(Subject, IPrivilegedAction, AccessControlContext) |
Perform privileged work as a particular |
DoAsPrivileged(Subject, IPrivilegedExceptionAction, AccessControlContext) |
Perform privileged work as a particular |
DoAsPrivileged(Subject, IPrivilegedAction, AccessControlContext)
Perform privileged work as a particular Subject
.
[Android.Runtime.Register("doAsPrivileged", "(Ljavax/security/auth/Subject;Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Lang.Object? DoAsPrivileged (Javax.Security.Auth.Subject? subject, Java.Security.IPrivilegedAction? action, Java.Security.AccessControlContext? acc);
[<Android.Runtime.Register("doAsPrivileged", "(Ljavax/security/auth/Subject;Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member DoAsPrivileged : Javax.Security.Auth.Subject * Java.Security.IPrivilegedAction * Java.Security.AccessControlContext -> Java.Lang.Object
Parameters
- subject
- Subject
the Subject
that the specified
action
will run as. This parameter
may be null
. <p>
- action
- IPrivilegedAction
the code to be run as the specified
Subject
. <p>
the AccessControlContext
to be tied to the
specified subject and action. <p>
Returns
the value returned by the PrivilegedAction's
run
method.
- Attributes
Remarks
Perform privileged work as a particular Subject
.
This method behaves exactly as Subject.doAs
, except that instead of retrieving the current Thread's AccessControlContext
, it uses the provided AccessControlContext
. If the provided AccessControlContext
is null
, this method instantiates a new AccessControlContext
with an empty collection of ProtectionDomains.
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
DoAsPrivileged(Subject, IPrivilegedExceptionAction, AccessControlContext)
Perform privileged work as a particular Subject
.
[Android.Runtime.Register("doAsPrivileged", "(Ljavax/security/auth/Subject;Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Lang.Object? DoAsPrivileged (Javax.Security.Auth.Subject? subject, Java.Security.IPrivilegedExceptionAction? action, Java.Security.AccessControlContext? acc);
[<Android.Runtime.Register("doAsPrivileged", "(Ljavax/security/auth/Subject;Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member DoAsPrivileged : Javax.Security.Auth.Subject * Java.Security.IPrivilegedExceptionAction * Java.Security.AccessControlContext -> Java.Lang.Object
Parameters
- subject
- Subject
the Subject
that the specified
action
will run as. This parameter
may be null
. <p>
- action
- IPrivilegedExceptionAction
the code to be run as the specified
Subject
. <p>
the AccessControlContext
to be tied to the
specified subject and action. <p>
Returns
the value returned by the
PrivilegedExceptionAction's run
method.
- Attributes
Remarks
Perform privileged work as a particular Subject
.
This method behaves exactly as Subject.doAs
, except that instead of retrieving the current Thread's AccessControlContext
, it uses the provided AccessControlContext
. If the provided AccessControlContext
is null
, this method instantiates a new AccessControlContext
with an empty collection of ProtectionDomains.
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.