|
@@ -90,7 +90,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
|
|
|
if (!school.isEnable()) {
|
|
|
throw ApiException.USER_DISABLED;
|
|
|
}
|
|
|
- if (!matchRole(authConfig, Role.SCHOOL_DEV)) {
|
|
|
+ if (authConfig != null && authConfig.value().length > 0&& !matchRole(authConfig, Role.SCHOOL_DEV)) {
|
|
|
throw ApiException.USER_ROLE_INVALID;
|
|
|
}
|
|
|
return buildApiUser(request, response, school);
|
|
@@ -109,7 +109,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
|
|
|
if (!user.isEnable()) {
|
|
|
throw ApiException.USER_DISABLED;
|
|
|
}
|
|
|
- if (!matchRole(authConfig, user.getRole())) {
|
|
|
+ if (authConfig != null && authConfig.value().length > 0 && !matchRole(authConfig, user.getRole())) {
|
|
|
throw ApiException.USER_ROLE_INVALID;
|
|
|
}
|
|
|
return buildApiUser(request, response, user);
|
|
@@ -129,7 +129,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
|
|
|
if (!user.isEnable()) {
|
|
|
throw ApiException.USER_DISABLED;
|
|
|
}
|
|
|
- if (!matchRole(authConfig, user.getRole())) {
|
|
|
+ if (authConfig != null && authConfig.value().length > 0&& !matchRole(authConfig, user.getRole())) {
|
|
|
throw ApiException.USER_ROLE_INVALID;
|
|
|
}
|
|
|
return buildApiUser(request, response, user);
|