|
|
@@ -9,7 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
|
|
|
|
|
+import com.uas.kanban.exception.OperationException;
|
|
|
import com.uas.kanban.model.ResourcePoint;
|
|
|
+import com.uas.kanban.model.ResourcePoint.Role;
|
|
|
import com.uas.kanban.support.SessionHelper;
|
|
|
import com.uas.kanban.support.SystemSession;
|
|
|
|
|
|
@@ -51,6 +53,12 @@ public class SecurityInterceptor extends HandlerInterceptorAdapter {
|
|
|
response.sendRedirect(contextPath + "/login");
|
|
|
return false;
|
|
|
}
|
|
|
+ if (url.startsWith("/resourcePoint/save") || url.startsWith("/resourcePoint/update")
|
|
|
+ || url.startsWith("/resourcePoint/delete") || url.startsWith("/resourcePoint/get")) {
|
|
|
+ if (resourcePoint.getRole() != Role.Admin) {
|
|
|
+ throw new OperationException("不允许的操作");
|
|
|
+ }
|
|
|
+ }
|
|
|
SystemSession.setResourcePoint(resourcePoint);
|
|
|
return true;
|
|
|
}
|