最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Security Jobs related to Dynamics AX 2012 Role Based Security

网络文摘 William 2529浏览 0评论

While working on security setup for one of my client, I need to do some investigations related to security objects. Resulted I have created few jobs that help me in my work. I am sharing here; it may help others also.

Finding all the Privilege related to specific menu items

static void findAllThePrivillageWithSpecificMenuItem(Args _args)
{
SecurityTask securityTask;
SecuritySubTask securitySubTask;
SecurityTaskEntryPoint SecurityTaskEntryPoint;
SecurableObject SecurableObject;

while select * from SecurityTaskEntryPoint
join SecurableObject
where SecurableObject.RecId == SecurityTaskEntryPoint.EntryPoint
&& SecurableObject.Name == menuitemdisplayStr(ProjGrant)
{

// 1. How to the find record ID of the privilege
while select * from securityTask
where securityTask.RecId == SecurityTaskEntryPoint.SecurityTask
{
info(strFmt(“%1,%2,%3,%4″, securityTask.AOTNAME, securityTask.Name, securityTask.Type, SecurityTaskEntryPoint.PermissionGroup));
}
}
}

Finding all the Duties related to specific Privilege

static void findAllTheDutiesWithSpecificPrivilage(Args _args)
{
SecurityTask securityTask;
SecuritySubTask securitySubTask;

// privilage name
#define.SecurityTask(“ProjGrantMaintain”)

// 1. How to the find record ID of the privilege
select firstOnly RecId from securityTask
where securityTask.AotName == #SecurityTask
&& securityTask.Type == SecurityTaskType::Privilege;

// 2. How to the find all the duties containing the specified privilege
while select SecurityTask from securitySubTask
where securitySubTask.SecuritySubTask == securityTask.RecId
{
select firstOnly * from securityTask
where securityTask.RecId == securitySubTask.SecurityTask;

info(strFmt(“%1,%2,%3″, securityTask.AOTNAME, securityTask.Name, securityTask.Type));
}
}


发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址