mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-18 14:28:08 +08:00
RBAC Support
1、RBAC 基于角色的访问控制(Role-Based Access Control )支持 2、修复用户组访问权限删除问题 3、DAO层整合 4、Javascript验证及AJAX提交优化
This commit is contained in:
@@ -4,7 +4,7 @@ import java.util.Date;
|
||||
import javax.servlet.ServletException;
|
||||
import org.apache.ibatis.io.VFS;
|
||||
import org.apache.mybatis.jpa.SpringBootVFS;
|
||||
import org.maxkey.web.InitApplicationContext;
|
||||
import org.maxkey.web.InitializeContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -24,7 +24,7 @@ public class MaxKeyApplication extends SpringBootServletInitializer {
|
||||
VFS.addImplClass(SpringBootVFS.class);
|
||||
ConfigurableApplicationContext applicationContext =
|
||||
SpringApplication.run(MaxKeyApplication.class, args);
|
||||
InitApplicationContext initWebContext = new InitApplicationContext(applicationContext);
|
||||
InitializeContext initWebContext = new InitializeContext(applicationContext);
|
||||
try {
|
||||
initWebContext.init(null);
|
||||
} catch (ServletException e) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.maxkey.constants.ConstantsProtocols;
|
||||
import org.maxkey.crypto.ReciprocalUtils;
|
||||
import org.maxkey.dao.service.AccountsService;
|
||||
import org.maxkey.dao.service.AppsService;
|
||||
import org.maxkey.dao.service.MyAppsListService;
|
||||
import org.maxkey.dao.service.UserInfoService;
|
||||
import org.maxkey.domain.Accounts;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
@@ -42,9 +41,6 @@ public class AppListController {
|
||||
@Autowired
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
MyAppsListService myAppsListService;
|
||||
|
||||
@Autowired
|
||||
AccountsService appUsersService;
|
||||
|
||||
@@ -82,7 +78,7 @@ public class AppListController {
|
||||
UserApps userApplications = new UserApps();
|
||||
userApplications.setUsername(WebContext.getUserInfo().getUsername());
|
||||
|
||||
List<UserApps> appList = myAppsListService.queryMyApps(userApplications);
|
||||
List<UserApps> appList = appsService.queryMyApps(userApplications);
|
||||
for (UserApps app : appList) {
|
||||
WebContext.setAttribute(app.getId(), app.getIcon());
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.maxkey.web.contorller;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import org.maxkey.constants.ConstantsOperateMessage;
|
||||
import org.maxkey.dao.service.MyProfileService;
|
||||
import org.maxkey.dao.service.UserInfoService;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.web.WebContext;
|
||||
@@ -27,9 +26,6 @@ public class ProfileController {
|
||||
@Autowired
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
private MyProfileService myProfileService;
|
||||
|
||||
@RequestMapping(value = { "/myProfile" })
|
||||
public ModelAndView forwardBasic() {
|
||||
ModelAndView modelAndView = new ModelAndView("profile/myProfile");
|
||||
@@ -69,7 +65,7 @@ public class ProfileController {
|
||||
// userInfo.setExtraAttribute(extraAttribute);
|
||||
// }
|
||||
|
||||
if (myProfileService.updateProfile(userInfo) > 0) {
|
||||
if (userInfoService.updateProfile(userInfo) > 0) {
|
||||
new Message(
|
||||
WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),
|
||||
userInfo, MessageType.success,
|
||||
|
||||
Reference in New Issue
Block a user