我想访问安全职责(代码中),但我不知道它们存储在哪里(在哪个表中)?
权限存储在SecurityTask中,现在我需要知道AX 2012中的职责存储位置。
谢谢。
答案 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)。