@Override
    public void authorize(Permission permission, NacosUser nacosUser) throws AccessException {
        if (Loggers.AUTH.isDebugEnabled()) {
            Loggers.AUTH.debug("auth permission: {}, nacosUser: {}", permission, nacosUser);
        }
        if (nacosUser.isGlobalAdmin()) {
            return;
        }
        if (hasGlobalAdminRole(nacosUser)) {
            return;
        }
        
        if (!roleService.hasPermission(nacosUser, permission)) {
            throw new AccessException("authorization failed!");
        }
    }
@Test
    void testAuthorize() {
        Permission permission = new Permission();
        NacosUser nacosUser = new NacosUser();
        when(roleService.hasPermission(nacosUser, permission)).thenReturn(false);
        
        assertThrows(AccessException.class, () -> {
            abstractAuthenticationManager.authorize(permission, nacosUser);
        });
    }