This singleton manages access to the data stored in an associated SecurityRegistry -instance.
In order to use methods that read from the registry, a SecurityAccess instance has to be acquired
first:
Example Code:
SecurityAccess access = SecurityAccessManager.getInstance();
ReadToken accessToken = access.acquireReadToken();
Role role = access.getRoleById( accessToken, 1 );
If write access is needed as well, one has to acquire the exclusive SecurityTransaction . This is only
possible if the User has the "write"-privilege.
Example Code:
SecurityAccess access = SecurityAccess.getInstance ();
SecurityTransaction lock = access.acquireSecurityTransaction (user);
access.registerUser (lock, "TESTUSER");
...
access.commitTransaction (lock);
// after committing changes are made persistent
author: Markus Schneider author: last edited by: $Author:wanhoff$ version: $Revision: 10606 $, $Date:26.03.2007$ |