当前位置: 首页 > wzjs >正文

dede 手机网站模板珠海seo推广

dede 手机网站模板,珠海seo推广,可以做公众号的网站,网站开发建设哪家好引言 权限管理是企业级应用的核心功能之一,OneCode 3.0通过esdright模块构建了一套灵活可扩展的权限引擎,支持组件、模块、流程等多维度的权限控制。本文将深入剖析其实现架构、核心组件及设计思想。 总体架构设计 OneCode权限引擎采用分层设计&#xff…

引言

权限管理是企业级应用的核心功能之一,OneCode 3.0通过esdright模块构建了一套灵活可扩展的权限引擎,支持组件、模块、流程等多维度的权限控制。本文将深入剖析其实现架构、核心组件及设计思想。

总体架构设计

OneCode权限引擎采用分层设计,通过类型化定义、树形结构展示和服务化处理构建完整权限体系:

1. 权限类型体系

通过RightType枚举定义三大核心权限类型,采用枚举扩展模式支持未来功能扩展:

public enum RightType implements TreeItem {comright("组件权限", "bpmfont bpmgongzuoliuzhutiguizeweihuguanli", true, false, false, AttributeNavService.class),moduleright("模块权限", "bpmfont bpmgongzuoliuxitongpeizhi", true, false, false, MenuFormulaService.class),bpmright("流程授权", "spafont spa-icon-app", true, false, false, BPMTreeRightIndex.class);// ... 类型定义与绑定类实现
}

每种权限类型绑定对应的处理类,实现职责分离。

2. 权限树结构设计

采用树形结构展示权限层级关系,核心实现包括:

  • BPMRightTree:流程权限树节点,关联流程定义ID和活动定义ID
  • ComRightTree:组件权限树节点,支持属性类型和公式类型双重分类
  • ModuleRightTree:模块权限树节点,关联模块定义信息

树节点通过@ChildTreeAnnotation实现动态加载,如组件权限树绑定AttributeNavService实现子节点加载:

@ChildTreeAnnotation(bindClass = AttributeNavService.class)
public ComRightTree(Attributetype attributetype, String currentClassName) {this.caption = attributetype.getName();this.currentClassName = currentClassName;this.id = attributetype.getType();this.imageClass = attributetype.getImageClass();this.attributetype = attributetype;
}

核心服务实现

权限引擎通过多个服务类实现权限的管理、验证和控制逻辑:

1. 权限入口控制器

RightIndex作为权限管理的入口控制器,提供三大权限类型的访问端点:

@Controller
@RequestMapping("/esd/right/")
@MethodChinaName(cname = "权限管理")
public class RightIndex {@MethodChinaName(cname = "组件授权")@RequestMapping(method = RequestMethod.POST, value = "ComRight")public TreeListResultModel<List<ComRightTree>> getComRight(String id, String projectName, String currentClassName) { ... }@MethodChinaName(cname = "模块授权")@RequestMapping(method = RequestMethod.POST, value = "ModuleRight")public TreeListResultModel<List<ModuleRightTree>> getModuleRight(String id, String projectName, String className) { ... }@MethodChinaName(cname = "流程授权")@RequestMapping(method = RequestMethod.POST, value = "BpmRight")public TreeListResultModel<List<BPMRightTree>> getBpmRight(String id, String projectName, String className) { ... }
}

通过@RequestMapping定义REST接口,使用TreePageUtil构建树形返回结果。

2. 模块权限服务

ModuleFormulaService实现模块权限的核心逻辑,包括表达式CRUD和权限验证:

  • 表达式管理:支持权限表达式的添加、编辑、删除和查询
  • 树形展示:通过getFormulaTree方法提供权限选择树
  • 权限验证:通过ESDClient与后端交互验证权限

关键实现代码:

@RequestMapping(method = RequestMethod.POST, value = "Index")
public ListResultModel<List<ModuleInstGridView>> getFormulaInstList(String projectName) {ListResultModel<List<ModuleInstGridView>> resultModel = new ListResultModel<>();try {Project config = ESDFacrory.getAdminESDClient().getProjectByName(projectName);List<FormulaInst> list = config.getFormulas();List<FormulaInst> instList = new ArrayList<>();for (FormulaInst inst : list) {if (inst.getFormulaType() != null && inst.getFormulaType().equals(FormulaType.ModuleRight)) {instList.add(inst);}}resultModel = PageUtil.getDefaultPageList(instList, ModuleInstGridView.class);} catch (JDSException e) {e.printStackTrace();}return resultModel;
}

3. 动作权限服务

ActionFormulaService专注于组件动作级别的权限控制,实现细粒度的操作权限管理:

@RequestMapping(method = RequestMethod.POST, value = "Index")
public ListResultModel<List<ModuleActionGridView>> getFormulaInstList(String projectName, String currentClassName) {// 从模块配置中筛选动作权限表达式ProjectVersion version = ESDFacrory.getAdminESDClient().getProjectVersionByName(projectName);EUModule euModule = ESDFacrory.getAdminESDClient().getModule(currentClassName, version.getVersionName());List<ModuleFormulaInst> list = euModule.getComponent().getFormulas();// ... 筛选与转换逻辑
}

组织权限集成

权限引擎与组织架构深度集成,通过org包下的服务类实现基于组织的权限控制:

1. 流程权限集成

BPMTreeRightIndex实现流程节点级别的权限控制,关联流程定义和活动定义:

@RequestMapping(method = RequestMethod.POST, value = "BPMRightNav")
public TreeListResultModel<List<BPMRightTree>> getOrgRightNav(String activityDefId, String processDefId, String projectName) {return TreePageUtil.getTreeList(Arrays.asList(BPMRightFormulaType.values()), BPMRightTree.class);
}

2. 阅办人授权

ReadFormulaService实现文档阅办权限的精细化控制,支持阅办人表达式的管理:

@RequestMapping(method = RequestMethod.POST, value = "Index")
public ListResultModel<List<ReadGridView>> getFormulaInstList(String projectId) {// 筛选阅办人权限表达式List<FormulaInst> instList = new ArrayList<>();for (FormulaInst inst : list) {if (inst != null && inst.getFormulaType() != null && inst.getFormulaType().equals(FormulaType.ReaderSelectedID)) {instList.add(inst);}}// ...
}

属性权限控制

AttributeNavService实现基于属性的权限控制,支持不同属性类型的权限差异化管理:

@RequestMapping(method = RequestMethod.POST, value = "FormulaList")
public ListResultModel<List<PageRightGridView>> getFormulaList(FormulaType formulaType, String projectName, String currentClassName) {// 根据公式类型筛选权限表达式List<FormulaInst> instList = new ArrayList<>();for (FormulaInst inst : list) {if (inst != null && inst.getFormulaType() != null && inst.getFormulaType().equals(formulaType)) {instList.add(inst);}}// ...
}

权限表达式引擎

权限引擎的核心在于表达式处理,通过公式定义实现灵活的权限规则:

  1. 表达式类型:通过FormulaType枚举定义多种权限表达式类型
  2. 表达式管理:支持表达式的添加、编辑、删除和查询
  3. 表达式执行:通过ESDFacrory.getAdminESDClient()与后端交互执行权限验证

关键代码示例(添加表达式):

@RequestMapping(value = {"addFormula"}, method = {RequestMethod.GET, RequestMethod.POST})
public @ResponseBody ResultModel<Boolean> addFormulaInst(String SelectFormulaTree, String projectName) {try {Project config = ESDFacrory.getAdminESDClient().getProjectByName(projectName);String[] formulaIdArr = StringUtility.split(SelectFormulaTree, ";");for (String id : formulaIdArr) {ParticipantSelect select = FormulaFactory.getInstance(ESDFacrory.getAdminESDClient().getSpace()).getFormulaById(id);FormulaInst inst = new FormulaInst();inst.setExpression(select.getFormula());inst.setFormulaType(select.getFormulaType());inst.setParticipantSelectId(select.getParticipantSelectId());inst.setName(select.getSelectName());inst.setFormulaInstId(UUID.randomUUID().toString());ESDFacrory.getAdminESDClient().updateFormulaConfig(config.getId(),inst);}} catch (JDSException e) {e.printStackTrace();}return resultModel;
}

与OneCode核心设计的契合

权限引擎深度融合OneCode的两大核心设计理念:

  1. 注解驱动开发:大量使用自定义注解实现权限元数据定义

    • @MethodChinaName:定义权限中文名称
    • @NavTreeViewAnnotation:声明树形导航视图
    • @APIEventAnnotation:绑定API事件处理
  2. 元数据驱动开发:通过FormulaInst等元数据对象描述权限规则,实现配置化权限管理

总结与展望

OneCode 3.0权限引擎通过类型化、层次化、服务化的设计,构建了灵活强大的权限管理体系。核心优势包括:

  • 多维度权限控制:支持组件、模块、流程等多层面权限管理
  • 细粒度权限定义:从功能到数据的精细化权限控制
  • 灵活的表达式引擎:通过公式定义实现复杂权限规则
  • 与组织架构深度集成:基于组织的权限分配与控制

未来可进一步增强AI能力,如基于用户行为推荐权限配置、智能检测权限冲突等,提升权限管理的智能化水平。

http://www.dtcms.com/wzjs/134331.html

相关文章:

  • 镇海住房和建设交通局网站网站开发合同
  • 一站式营销型网站建设短视频运营培训学费多少
  • 上海网站代优化在线代理浏览网站免费
  • 广西旅游网站建设怎么做seo关键词优化
  • 网站出现 503怎么了seo网络优化招聘信息
  • 网页设计作业分析文档seo关键词排名优化软件
  • 石家庄网站建设模板服务免费自己建网站
  • 网站优化报告面点培训学校哪里有
  • 中国建设论坛网站大全效果好的关键词如何优化
  • 海北公司网站建设多少钱电脑培训班零基础
  • dede 网站地图样式谷歌seo公司
  • 做食物外网视频网站虚拟主机搭建网站
  • 河北省建设工程网站我的百度账号
  • 破解网站后台密码接推广一般多少钱
  • 银川网站建设银川网络推广的细节
  • 和凡科网类似的网站游戏推广代理app
  • 白云区同和网站建设网店如何推广
  • 微网站是什么公司网站制作需要多少钱
  • 衡水网站建设维护廊坊seo
  • 德州制作网站哪家最专业株洲seo推广
  • 2023年免费进入b站的原因b站推广是什么意思
  • b2c商城网站建设梅州seo
  • 湖南做网站找谁市场营销案例分析
  • 网站运营和维护都是干什么的谷歌收录查询工具
  • 自己做的动画买给网站注册平台
  • 用了mip的网站sem竞价代运营公司
  • 厦门网站制作维护宣传软文怎么写
  • 寮步网站建设哪家好深圳seo公司排名
  • 彩票网站的表格是如何做的网络营销推广实训报告
  • 市场监督管理局不处理问题怎么办seo站长论坛