起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 310|回复: 1

[结贴] 判断当前操作者是否拥有指定动作的权限问题

[复制链接]

107

主题

339

帖子

2090

积分

金牌会员

Rank: 6Rank: 6

积分
2090
QQ
发表于 2014-9-24 20:17:47 | 显示全部楼层 |阅读模式
版本: 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
在JAva中执行以下代码出错:
            //判断当前操作者是否拥有指定动作的权限  
          Operator operator = ContextHelper.getOperator();
           boolean  hasPermission =  operator.hasActionPermission(process, activity, action, operator.getID()) ;  

机构下的用户,运行都报错
system 用户 如果无机构  不报错,system如果在机构下,也报错

错误代码:
  1. 2014-09-24 20:11:02 action:<?xml version="1.0" encoding="UTF-8"?>
  2. <action direct-execute="false" process="/OA/Estate/process/client/clientProcess" activity="clientManageActivity1" action-flag="__action_0__" executor="1694BB4677554F0FB979D4695138D316" execute-context="" name="rightsManagementAction"><parameters xmlns:xbiz="http://www.justep.com/xbiz#"><parameter name="type"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[management]]></xbiz:simple></parameter><parameter name="operatorData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[OA_Est_customer]]></xbiz:simple></parameter><parameter name="paramMap"><xbiz:map><item key="OA_Est_customer"><xbiz:map><item key="url"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="process"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="activity"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="masterData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="deleteMech"><xbiz:map><item key="Unconditional"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="Business"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Roles"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Unlimited"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="Check"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Related"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Creator"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Director"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="CurrentData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="DeleteAssociation"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="RolesPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="BusinessPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item></xbiz:map></item><item key="newMech"><xbiz:map><item key="Unconditional"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Roles"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="Business"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="CurrentData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="NewAssociation"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="RolesPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[operateNewAction]]></xbiz:simple></item><item key="BusinessPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item></xbiz:map></item><item key="editMech"><xbiz:map><item key="Unconditional"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">true</xbiz:simple></item><item key="Business"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Roles"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="CurrentData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="EditAssociation"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Unlimited"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Creator"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Director"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Check"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Related"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="RolesPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="BusinessPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item></xbiz:map></item><item key="viewMech"><xbiz:map><item key="Unconditional"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Roles"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="RolesPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="BusinessPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item></xbiz:map></item><item key="checkMech"><xbiz:map><item key="Unconditional"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Business"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Roles"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Unlimited"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Creator"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="Reset"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="CurrentData"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="CheckAssociation"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#Boolean">false</xbiz:simple></item><item key="RolesPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item><item key="BusinessPermissions"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"/></item></xbiz:map></item></xbiz:map></item><item key="operator"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[new]]></xbiz:simple></item><item key="OperatorID"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[1694BB4677554F0FB979D4695138D316]]></xbiz:simple></item><item key="executor"><xbiz:simple type="http://www.w3.org/2001/XMLSchema#String"><![CDATA[1694BB4677554F0FB979D4695138D316]]></xbiz:simple></item></xbiz:map></parameter></parameters></action>
  3. java.lang.reflect.InvocationTargetException
  4.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  5.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  6.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  7.         at java.lang.reflect.Method.invoke(Method.java:592)
  8.         at com.justep.system.action.Engine.invokeActions(Native Method)
  9.         at com.justep.system.action.Engine.invokeActions(Unknown Source)
  10.         at com.justep.business.server.BusinessServer.doAction(Unknown Source)
  11.         at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
  12.         at com.justep.business.server.BusinessServer.excute(Unknown Source)
  13.         at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
  14.         at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
  15.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  16.         at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
  17.         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  18.         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  19.         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  20.         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  21.         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  22.         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  23.         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  24.         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  25.         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  26.         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
  27.         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  28.         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  29.         at java.lang.Thread.run(Thread.java:595)
  30. Caused by: com.justep.exception.BusinessException: 编码: JUSTEP050006; 提示: 参数"fullName"不允许为空
  31.         at com.justep.exception.BusinessException.create(Unknown Source)
  32.         at com.justep.util.Utils.check(Unknown Source)
  33.         at com.justep.model.ModelUtils.getProcess(Unknown Source)
  34.         at com.justep.system.opm.Operator.hasActionPermission(Unknown Source)
  35.         at Estate.rolesPrivilegeAudit(Estate.java:721)
  36.         at Estate.privilegeAudit(Estate.java:670)
  37.         at Estate.rightsManagement(Estate.java:586)
  38.         ... 26 more
复制代码
请教如何解决?


107

主题

339

帖子

2090

积分

金牌会员

Rank: 6Rank: 6

积分
2090
QQ
 楼主| 发表于 2014-9-24 21:37:57 | 显示全部楼层
已经解决,是activity设置有误,请结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-6-16 13:14 , Processed in 0.089758 second(s), 25 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表