Code example for AccessControlException

0
        if (annotation != null) {
            String[] roles = annotation.value();
            //String role = AccessControl.getCurrentRole(); 
            String role = "admin";
            if (!Arrays.asList(roles).contains(role)) {
                throw new AccessControlException("该用户每权限访问该方法.");
            } 
        } 
        return method.invoke(accessObj, args);
    } 
}