|
@@ -8,6 +8,7 @@ import com.boman.common.redis.service.RedisService;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.SysRoleData;
|
|
import com.boman.domain.SysRoleData;
|
|
import com.boman.domain.constant.FormDataConstant;
|
|
import com.boman.domain.constant.FormDataConstant;
|
|
|
|
+import com.boman.domain.constant.GlobalBtn;
|
|
import com.boman.domain.exception.NoSuchFunctionException;
|
|
import com.boman.domain.exception.NoSuchFunctionException;
|
|
import com.boman.system.api.RemoteMenuService;
|
|
import com.boman.system.api.RemoteMenuService;
|
|
import com.boman.system.api.RemoteRoleDataService;
|
|
import com.boman.system.api.RemoteRoleDataService;
|
|
@@ -35,7 +36,7 @@ public class AuthUtils {
|
|
|
|
|
|
public static boolean checkAuthObjectDelete(GenTable genTable, Long id, String pkName) {
|
|
public static boolean checkAuthObjectDelete(GenTable genTable, Long id, String pkName) {
|
|
String functionName = genTable.getFunctionName();
|
|
String functionName = genTable.getFunctionName();
|
|
- if (!containsFunctionBool(genTable.getMenuRole(), GenTable.D, functionName)) {
|
|
|
|
|
|
+ if (!containsFunctionBool(genTable.getMenuRole(), GlobalBtn.D, functionName)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -45,7 +46,7 @@ public class AuthUtils {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!checkPermsAuthBool(tableName, GenTable.D)) {
|
|
|
|
|
|
+ if (!checkPermsAuthBool(tableName, GlobalBtn.D)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -53,7 +54,7 @@ public class AuthUtils {
|
|
}
|
|
}
|
|
|
|
|
|
public static void checkAuthQueryList(GenTable genTable, JSONObject condition) {
|
|
public static void checkAuthQueryList(GenTable genTable, JSONObject condition) {
|
|
- containsFunction(genTable.getMenuRole(), GenTable.Q, "此模块:[" + genTable.getFunctionName() + "], 没有查询功能");
|
|
|
|
|
|
+ containsFunction(genTable.getMenuRole(), GlobalBtn.Q, "此模块:[" + genTable.getFunctionName() + "], 没有查询功能");
|
|
|
|
|
|
LoginUser loginUser = getLoginUser();
|
|
LoginUser loginUser = getLoginUser();
|
|
if (SysUser.isAdmin(loginUser.getUserid())) {
|
|
if (SysUser.isAdmin(loginUser.getUserid())) {
|
|
@@ -172,7 +173,7 @@ public class AuthUtils {
|
|
List<String> permsList = getLoginUserPermsList();
|
|
List<String> permsList = getLoginUserPermsList();
|
|
String perms = packPermsKey(tableName, funcType);
|
|
String perms = packPermsKey(tableName, funcType);
|
|
if (!permsList.contains(perms)) {
|
|
if (!permsList.contains(perms)) {
|
|
- LOGGER.error("非法操作,操作人: {},tableName: {}, 操作类型: 此人未配置 {} 权限", getLoginUser().getUsername(), tableName, funcType(GenTable.D));
|
|
|
|
|
|
+ LOGGER.error("非法操作,操作人: {},tableName: {}, 操作类型: 此人未配置 {} 权限", getLoginUser().getUsername(), tableName, funcType(GlobalBtn.D));
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -284,21 +285,21 @@ public class AuthUtils {
|
|
|
|
|
|
public static String funcType(String funcType) {
|
|
public static String funcType(String funcType) {
|
|
switch (funcType) {
|
|
switch (funcType) {
|
|
- case GenTable.A:
|
|
|
|
|
|
+ case GlobalBtn.A:
|
|
return "新增";
|
|
return "新增";
|
|
- case GenTable.M:
|
|
|
|
|
|
+ case GlobalBtn.M:
|
|
return "修改";
|
|
return "修改";
|
|
- case GenTable.D:
|
|
|
|
|
|
+ case GlobalBtn.D:
|
|
return "删除";
|
|
return "删除";
|
|
- case GenTable.Q:
|
|
|
|
|
|
+ case GlobalBtn.Q:
|
|
return "查询";
|
|
return "查询";
|
|
- case GenTable.S:
|
|
|
|
|
|
+ case GlobalBtn.S:
|
|
return "提交";
|
|
return "提交";
|
|
- case GenTable.U:
|
|
|
|
|
|
+ case GlobalBtn.U:
|
|
return "反提交";
|
|
return "反提交";
|
|
- case GenTable.E:
|
|
|
|
|
|
+ case GlobalBtn.E:
|
|
return "导出";
|
|
return "导出";
|
|
- case GenTable.I:
|
|
|
|
|
|
+ case GlobalBtn.I:
|
|
return "导入";
|
|
return "导入";
|
|
default:
|
|
default:
|
|
return "未知";
|
|
return "未知";
|