Code example for Permissions

Methods: implies

0
/** 
 * Tests for class Identity 
 *  
 */ 
@SuppressWarnings("deprecation") 
@TestTargetClass(Identity.class)
public class IdentityTest extends TestCase {
 
    public static class MySecurityManager extends SecurityManager {
        public Permissions denied = new Permissions(); 
        public void checkPermission(Permission permission){
            if (denied!=null && denied.implies(permission)) throw new SecurityException();
        } 
    } 
     
    public static void main(String[] args) {
        junit.textui.TestRunner.run(IdentityTest.class); 
    } 
 
    @TestTargetNew( 
        level = TestLevel.PARTIAL,