CodeAccessPermission.demand Method

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


public void demand()

Run On



The following code example shows a call to the demand method before the API functionality is executed, to determine whether permission to access the resource that is specified by the data variable has been granted to code that is calling the API.

public static void main(str data) 
    SysTestCodeAccessPermission p = new SysTestCodeAccessPermission(data); 
    //Add functionality 

This code example illustrates a step in the process of protecting an API.

See Also

CodeAccessPermission Class

CodeAccessPermission Class