次の方法で共有


ExecutePermission Class

Definition

The ExecutePermission class controls the execution of X++ code.

public ref class ExecutePermission : Microsoft::Dynamics::Ax::Xpp::CodeAccessPermission
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
[Microsoft.Dynamics.BusinessPlatform.SharedTypes.InternalUseOnly]
public class ExecutePermission : Microsoft.Dynamics.Ax.Xpp.CodeAccessPermission
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
[<Microsoft.Dynamics.BusinessPlatform.SharedTypes.InternalUseOnly>]
type ExecutePermission = class
    inherit CodeAccessPermission
Public Class ExecutePermission
Inherits CodeAccessPermission
Inheritance
Microsoft.Dynamics.AX.KernelInterop.ProxyBase
ExecutePermission
Attributes
KernelClassAttribute Microsoft.Dynamics.BusinessPlatform.SharedTypes.InternalUseOnlyAttribute

Remarks

This class is designed to check permissions for specific APIs. For a list of all APIs that are protected by permissions, see Secured APIs. Before the protected API is executed, you must call the assert method on the same tier (which is usually the server tier) that the corresponding CodeAccessPermission::demand method is called on. Call a method on the server tier from one of the following methods:

  • A server static method
  • A class instance method that is set to run on the server by using the RunOn class property

The following code example shows a new instance of the ExecutePermission class. The assert method is called to declare that the code can then call the Thread.new method to create a new thread.

server static void main(Args args) 
{ 
    Thread _t; 
    ExecutePermission _perm; 
    _perm = new ExecutePermission(); 
    if (!_perm) 
    { 
        return; 
    } 
    _perm.assert(); 
    // Invoke the protected API. 
     _t = new Thread(); 
    // Call member methods. 
    if (_t) 
    { 
        _t.removeOnComplete(true); 
        _t.run(classnum(SysCodeProfiler), identifierstr(transferFile)); 
    } 
    // Optionally, call revertAssert() to limit scope of assert. 
    CodeAccessPermission::revertAssert(); 
}

Constructors

ExecutePermission()
ExecutePermission(IntPtr)

Fields

__k_ExecutePermissionId
kernelClass (Inherited from XppObjectBase)

Methods

__shouldCallNew(Type)
addXppProxyReference(Type, Object) (Inherited from XppObjectBase)
assert()

Declares that the calling code can invoke an API that is protected by a permission.

(Inherited from CodeAccessPermission)
Call(String, Object[], Type[], Object[]) (Inherited from XppObjectBase)
cancelTimeOut(Int32) (Inherited from XppObjectBase)
Copy()

Creates and returns a copy of the current permission class object.

createKernelClass(Object[], Type[], Object[]) (Inherited from XppObjectBase)
demand()

Checks the call stack to determine whether the permission that is required to invoke an API has been granted to the calling code.

(Inherited from CodeAccessPermission)
equal(XppObjectBase) (Inherited from XppObjectBase)
finalize() (Inherited from XppObjectBase)
GetIntPtr() (Inherited from XppObjectBase)
GetKernelInstanceUniqueId() (Inherited from XppObjectBase)
getTimeOutTimerHandle() (Inherited from XppObjectBase)
getXppProxyReference(Type) (Inherited from XppObjectBase)
handle()
IsManagedValid() (Inherited from XppObjectBase)
Issubsetof(CodeAccessPermission)

Determines whether a current permission is a subset of the specified permission.

kernelhandle()
KernelInstanceDisposed() (Inherited from XppObjectBase)
MakeReflectionCall(String, Object[]) (Inherited from XppObjectBase)
newmethod()

Initializes a new instance of the ExecutePermission class. End.

notify() (Inherited from XppObjectBase)
notifyAll() (Inherited from XppObjectBase)
objectOnServer()
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32, Boolean)
Obsolete.
(Inherited from XppObjectBase)
setTimeOut(String, Int32)
Obsolete.
(Inherited from XppObjectBase)
usageCount() (Inherited from XppObjectBase)
VerifyKernelClass() (Inherited from XppObjectBase)
wait() (Inherited from XppObjectBase)
Xml() (Inherited from XppObjectBase)
Xml(Int32) (Inherited from XppObjectBase)

Applies to