Merge pull request #9137 from dataease/pr@dev-v2@featPermission

feat(用户管理): 支持用户扩展字段用于配置行权限系统变量
This commit is contained in:
taojinlong 2024-04-16 17:20:31 +08:00 committed by GitHub
commit 5740912149
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 1 deletions

View File

@ -198,6 +198,9 @@ public class PermissionManage {
if (StringUtils.isNotEmpty(userEntity.getName())) {
expressionTree = expressionTree.replaceAll("\\$\\{sysParams\\.userName}", userEntity.getName());
}
if (StringUtils.isNotEmpty(userEntity.getLabel())) {
expressionTree = expressionTree.replaceAll("\\$\\{sysParams\\.userLabel}", userEntity.getLabel());
}
record.setExpressionTree(expressionTree);
DatasetRowPermissionsTreeObj tree = JsonUtil.parseObject(expressionTree, DatasetRowPermissionsTreeObj.class);
record.setTree(tree);

View File

@ -182,6 +182,7 @@ export default {
user_id: '账号',
user_name: '姓名',
user_source: '用户来源',
user_label: '用户标签',
user_email: '邮箱',
dept: '组织',
role: '角色'

View File

@ -20,7 +20,7 @@ const valueOptions = valueEnum.map(formatEnum)
const sysParams = ['eq', 'not_eq', 'like', 'not like', 'in', 'not in']
const textOptionsForSysParams = sysParams.map(formatEnum)
const sysParamsEnum = ['userId', 'userName', 'userEmail']
const sysParamsEnum = ['userId', 'userName', 'userEmail', 'userLabel']
const sysParamsIlns = sysParamsEnum.map(_ => {
return { value: `\${sysParams.${_}}`, label: `auth.sysParams_type.${toLine(_)}` }

View File

@ -31,4 +31,6 @@ public class UserCreator implements Serializable {
@Schema(hidden = true)
@JsonIgnore
private Long uid;
@Schema(description = "标签", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private String label;
}

View File

@ -42,4 +42,7 @@ public class UserFormVO implements Serializable {
@Schema(description = "模式")
private String model;
@Schema(description = "标签")
private String label;
}