Code example for AccessControlException

0
        if (annotation != null) {
            String[] roles = annotation.value();
            String role = AccessControl.getCurrentRole();
            if (!Arrays.asList(roles).contains(role)) {
            	System.out.println("该角色木有权限哇~");
                throw new AccessControlException("The user is not allowed to invoke this method.");
            } 
        } 
        return method.invoke(accessObj, args);
         
//        java.util.Observable 
    }  
     
}  
Connect your IDE to all the code out there  Get Codota for Java