#include <coherence/security/RunAsBlock.hpp>
The RunAsBlock object will push the Subject onto a thread-local "current subject" upon entering the block, and pop the subject upon exiting the code block.
A more friendly form is to use the COH_RUN_AS macro. Example usage:
COH_RUN_AS(vSubject) { // code here will considered to be run by the supplied subject // ... // ... } // subject will be reverted
Public Member Functions | |
RunAsBlock (TypedHandle< const Subject > vSubject) | |
Construct a RunAsBlock object. | |
RunAsBlock (const RunAsBlock &that) | |
Copy constructor, for use by COH_RUN_AS macro. | |
~RunAsBlock () | |
Destroy a RunAsBlock object. |
RunAsBlock | ( | TypedHandle< const Subject > | vSubject | ) |
Construct a RunAsBlock object.
This will automatically set the thread's Subject.
RunAsBlock | ( | const RunAsBlock & | that | ) |
Copy constructor, for use by COH_RUN_AS macro.
The new block takes over the ownership of the pop.
~RunAsBlock | ( | ) |
Destroy a RunAsBlock object.
This will automatically pop the Subject.