|
用代码实现功能分配在开发环境运行完全正常,但是在正式环境下就不能分配功能, 功能分配函数如下
//UserURL是人员地址,FuncURL是功能地址
procedure TQXGL.AssignFunc(UserURL, FuncURL: string);
var
AParent : TBizURL;
lOrigin : TOrgUnit;
lItems : TOrgFuncAllocItems;
begin
AParent := TBizURL.Create;
try
AParent.URL := UserURL; //用户URL
lOrigin := OrgSys.OrgSystem.GetUnit(AParent);
lItems := lOrigin.Module.RunFuncAlloc;
if not lItems.ExistFunc(FuncURL) then
lItems.AddItem(FuncURL);
OrgSys.OrgSystem.SaveUnit(lOrigin);
finally
AParent.Free;
end;
end; |
|