Greetings! I have a problem setting an authorization permission in an application

I tweaked a bit the files from the Java Authorization tutorial, found here:
JAAS Authorization Tutorial

What I want is to implement a permission rule on the SampleAzn class, I want a
particular user, namely admin, to be able to run the doAsPrivileged instruction within the SampleAzn code

SampleAzn code:

Subject mySubject = lc.getSubject();
// let's see what Principals we have
Iterator principalIterator = mySubject.getPrincipals().iterator();
System.out.println("Authenticated user has the following Principals:");

PrivilegedAction action = new usePrintServer( current_principal );
Subject.doAsPrivileged(mySubject, action, null);

the user admin, has been authenticated, and the next method to be executed is doAsPrivileged. admin is added as a principal in the Subject

Below, is the policy file I use, concerning the SampleAzn class

grant codebase "file:./SampleAzn.jar" {
permission "createLoginContext.Sample";
// permission "doAsPrivileged";

grant codebase "file:./SampleAzn.jar",
Principal sample.principal.SamplePrincipal "admin" {

permission "getSubject";
permission "createLoginContext.Sample";
permission "doAsPrivileged";

What I want, is to make admin the only principal who is able to execute the doAsPrivileged instruction. If I remove the // characters, the code runs file, since no authorization is applied on SampleAzn. But with the comments, the output is the following exception:

Authenticated user has the following Principals:
SamplePrincipal: admin
User has 0 Public Credential(s)
Exception in thread "main" access denied ( doAsPrivileged)
at (
at java.lang.SecurityManager.checkPermission(Security
at .java:439)
at sample.SampleAzn.main(

What could be wrong? Is there a way to fix this, while the principal admin has exclusive execution rights??

Thanx for your time