【问题标题】:List all users that have permission for a given table in Dynamics ax 2009列出对 Dynamics ax 2009 中给定表具有权限的所有用户
【发布时间】:2018-10-26 11:52:00
【问题描述】:

我有一些自定义表格,几年前由某家公司在我们的环境中实施。

我需要列出用户及其对该表的权限。 我发现了 ACCESSRIGHTSLIST 表,其中包含我想要的所有内容,例如组和关联用户。

问题是此列表不完整,用户可以在我通过 ACCESSRIGHTSLIST 找到的组之外修改/查看此表。

我知道 dicttable.rights() 会做得很好,但我不能在这里指定用户,它只验证正在执行代码的用户。

我基本上需要的是 dicttable.rights(someUserID),但由于我看不到 dicttable 使用什么机制,所以我被卡住了。

我在 AX 2009 工作。

【问题讨论】:

    标签: axapta dynamics-ax-2009


    【解决方案1】:

    相反,创建一个static server 方法并使用runas 命令调用它,您可以在其中runas 您想要的不同用户。

    见:

    或在系统中搜索示例代码。

    【讨论】:

      【解决方案2】:

      我现在无法访问 AX 2009,但据我记得您应该可以使用系统类 SecurityKeySet。检查以下是否有效:

      SecurityKeySet  securityKeySet; 
      AccessType      accessType;
      UserId          userId      = curUserId();
      TableId         tableId     = tableNum(CustTable);
      ;
      
      securityKeySet = new SecurityKeySet(); 
      securityKeySet.loadUserRights(userId);
      
      accessType = securityKeySet.tableAccess(tableId);
      
      info(strFmt('%1', accessType));
      

      【讨论】:

      • 这里有更好的答案。我回答了你的问题,这满足了你的需要。
      猜你喜欢
      • 1970-01-01
      • 2016-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多