|
@@ -33,7 +33,7 @@ public class UserRoleInterceptor implements HandlerInterceptor {
|
|
|
|| uri.startsWith("/api/content/exam/question")
|
|
|| uri.startsWith("/api/content/exam/question")
|
|
|
|| uri.startsWith("/api/content/exam/paper")) {
|
|
|| uri.startsWith("/api/content/exam/paper")) {
|
|
|
if (!UserContext.getUserRoles().contains(AccountRole.examAdmin.getValue())) {
|
|
if (!UserContext.getUserRoles().contains(AccountRole.examAdmin.getValue())) {
|
|
|
- String msg = "Current user not ExamAdmin";
|
|
|
|
|
|
|
+ String msg = String.format("current user not grant %s role", AccountRole.examAdmin.getDesc());
|
|
|
writeResponse(response, msg);
|
|
writeResponse(response, msg);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -41,7 +41,7 @@ public class UserRoleInterceptor implements HandlerInterceptor {
|
|
|
|
|
|
|
|
if (uri.startsWith("/api/content/exam/eval")
|
|
if (uri.startsWith("/api/content/exam/eval")
|
|
|
&& !UserContext.getUserRoles().contains(AccountRole.examUser.getValue())) {
|
|
&& !UserContext.getUserRoles().contains(AccountRole.examUser.getValue())) {
|
|
|
- String msg = "Current user not ExamUser";
|
|
|
|
|
|
|
+ String msg = String.format("current user not grant %s role", AccountRole.examUser.getDesc());
|
|
|
writeResponse(response, msg);
|
|
writeResponse(response, msg);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -49,7 +49,7 @@ public class UserRoleInterceptor implements HandlerInterceptor {
|
|
|
|
|
|
|
|
if (uri.startsWith("/api/content/disk")
|
|
if (uri.startsWith("/api/content/disk")
|
|
|
&& !UserContext.getUserRoles().contains(AccountRole.disk.getValue())) {
|
|
&& !UserContext.getUserRoles().contains(AccountRole.disk.getValue())) {
|
|
|
- String msg = "current user not grant ROLE_DISK";
|
|
|
|
|
|
|
+ String msg = String.format("current user not grant %s role", AccountRole.disk.getDesc());
|
|
|
writeResponse(response, msg);
|
|
writeResponse(response, msg);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|