起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 155|回复: 6

【结】急急 客户端与初始化结果不符**

[复制链接]
发表于 2008-3-14 16:43:42 | 显示全部楼层 |阅读模式
客户端与初始化结果不符

  程序取得用户所有的权限,然后判断哪些功能可以使用,可是初始化

达到目的,客户端不是期望的结果

关键代码如下

procedure TCT_PDGZT.InitUserPower;
var
  //list: TOrgFuncItems;
  list: TOrgFuncAllocItems;
  OrgUnit:TOrgUnit;
  I: integer;
  lContextCurrent: Business.Model.TContextCurrent;
  strOrgFunc:string;
begin
  try
  UserPower:=TUserPower.Create;
  lContextCurrent := Business.Model.TContextCurrent.Create(Self.Context);
  list := TOrgFuncAllocItems.Create;
  OrgSys.OrgSystem.GetAllFunc(lContextCurrent.OperatorPosition.PersonMember, TOrgFuncKind.ofkRun, list);
   if (list.Count>0) then
    begin
      for I := 0 to list.Count - 1 do
      begin
        strOrgFunc:=SysUtils.UpperCase(TOrgFuncAllocItem(list.Items[I]).FuncURL.Trim);
        if strOrgFunc= SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBDA.FUNC') then //配电设备
        begin
        UserPower.SB:=true;
        end;
        if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBZTPJ.FUNC') then//配电设备评价
        begin
        UserPower.PJ:=true;
        end;
        if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDDYZGZPTX.FUNC')  then  //配电一种工作票 申请
        begin
        UserPower.YZGZP:=true;
        end;
        if strOrgFunc= SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_SQPDDEZGZP.FUNC') then  //配电二种工作票 申请
        begin
        UserPower.RZGZP:=true;
        end;
        if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSQRTXBDTDSQD.FUNC')  then//配电停电票申请
        begin
        UserPower.TDSQP:=true;
        end;
        if strOrgFunc=SysUtils.UpperCase('BIZ:\SCMISYWKJ\GN_PDSBQXDJ.FUNC')  then  //配电缺陷
        begin
        UserPower.SBQX:=true;
        end;
      end;
      end;
  finally
   lContextCurrent.Free;
    list.Free;
  end;
end;
回复

使用道具 举报

发表于 2008-3-14 18:23:54 | 显示全部楼层
客户端不是期望的结果。

有什么具体表现呢?如:
某个已经分配的功能在list中不存在?
回复 支持 反对

使用道具 举报

发表于 2008-3-14 18:39:05 | 显示全部楼层
楼主,1、你看一下Studo中的中工具/选项/调试/登录中的人员,与你的business登陆的是同一个人吗?
2、重新刷一下缓存,若刷过不管用,把缓存关了,再试一下
回复 支持 反对

使用道具 举报

发表于 2008-3-17 10:26:12 | 显示全部楼层
OrgSys.OrgSystem.GetAllFunc(lContextCurrent.OperatorPosition.PersonMember, TOrgFuncKind.ofkRun, list);
只是得到运行这个功能的岗位环境的对应人员成员的所有功能权限,如果这个人有多个岗位,那么这里只能得到一个岗位的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-17 10:35:04 | 显示全部楼层
我也是这么想的,那么,有什么办法可以得到这个人的所有岗位的功能呢?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-17 12:27:53 | 显示全部楼层
搞定
回复 支持 反对

使用道具 举报

发表于 2008-3-17 13:10:54 | 显示全部楼层
lContextCurrent.Operator.Positions[1].PersonMember
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-8 19:06 , Processed in 0.042912 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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