AX中存储的职责(表名)在哪里?

时间:2012-11-16 07:50:20

标签: x++ axapta dynamics-ax-2012

我想访问安全职责(代码中),但我不知道它们存储在哪里(在哪个表中)?

权限存储在SecurityTask中,现在我需要知道AX 2012中的职责存储位置。

谢谢。

2 个答案:

答案 0 :(得分:1)

我在这里找到了它:http://arsalanax.blogspot.be/2012/02/role-based-security-in-ax.html

角色存储在SecurityRole

SecurityUserRole中的用户到角色映射

职责&存储在SecurityTask中的权限

特权映射的责任存储在SecuritySubTask

职责映射的角色存储在SecurityRoleTaskGrant

更新(添加查询)

SecurityTaskEntryPoint  taskEntryPoint;
SecurityRole            role;
SecurityRoleTaskGrant   taskGrant;
SecuritySubTask         subTask;
SecurityTask            privilege;
str privName;
str dutyName;
str entrName;
str accessLevel;
;

while select taskEntryPoint
join subTask
    where subTask.SecuritySubTask == taskEntryPoint.SecurityTask
join taskGrant
    where taskGrant.SecurityTask == subTask.SecurityTask
join role
    where role.RecId == taskGrant.SecurityRole
    &&  role.AotName like 'Sales*'
    //|| role.AotName like 'System*'
{
     if (subTask.RecId)
    {
        switch (taskEntryPoint.PermissionGroup)
        {
            case AccessRight::View:
                accessLevel = "R";
                break;
            case AccessRight::Edit:
                accessLevel = "U";
                break;
            case AccessRight::Add:
                accessLevel = "C";
                break;
            case AccessRight::Delete:
                accessLevel = "D";
                break;
            default:
                accessLevel = "";
                break;
        }
    }

    select privilege
        where privilege.RecId == taskGrant.SecurityTask
        && SecurityTaskType::Duty == privilege.Type;
    dutyName = privilege.AotName;

    select privilege
        where privilege.RecId == subTask.SecuritySubTask
        && SecurityTaskType::Privilege == privilege.Type;
    privName = privilege.AotName;

    info(strFmt("EP: %1, Pr: '%2', Du: %3, Ro: %4, Ac: %5", taskEntryPoint.EntryPoint, privName, dutyName, role.AotName, accessLevel));
}

答案 1 :(得分:1)

安全职责在表SecurityTask中,类型等于1(SecurityTaskType :: Duty)。

安全权限在表SecurityTask中,Type等于0(SecurityTaskType :: Privilege)

安全流程周期在表SecurityTask中,Type等于2(SecurityTaskType :: ProcessCycle)。

所有这些对象也在表格中(或更确切地说是视图)SysModelElement(要素与ElementType == 135)。