Code example for Permission

Methods: getName

0
            } 
 
            @Override 
            public void checkPermission(Permission permission) {
                if (permission instanceof AuthPermission
                        && "doAsPrivileged".equals(permission.getName())) {
                    called = true;
                } 
            } 
        } 
 
        AccessControlContext acc = new AccessControlContext(
                new ProtectionDomain[0]);
        Subject subject = new Subject();
 
        TestSecurityManager s = new TestSecurityManager();
        System.setSecurityManager(s);
 
        s.reset();
        Subject.doAsPrivileged(subject, new PrivilegedAction<Object>() {
            public Object run() {