x++


Where are Duties (table name) stored in AX?


I want to access Security duties (in code), but I don't know where they are stored (in which table)?
Privileges are stored in SecurityTask, now I need to know where duties are stored in AX 2012.
Thank you.
Security duties are in table SecurityTask with Type equal to 1 (SecurityTaskType::Duty).
Security privileges are in table SecurityTask with Type equal to 0 (SecurityTaskType::Privilege)
Security process cycles are in table SecurityTask with Type equal to 2 (SecurityTaskType::ProcessCycle).
All these objects are also in table (or rather view) SysModelElement (Duties with ElementType == 135).
I found it here: http://arsalanax.blogspot.be/2012/02/role-based-security-in-ax.html
Roles are stored in SecurityRole
User to role mappings in SecurityUserRole
Duties & privileges stored in SecurityTask
Duty to privileges mappings are stored in SecuritySubTask
Role to duty mappings are stored in SecurityRoleTaskGrant
UPDATE (query added)
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));
}

Related Links

Find code that's running in a Batch Job
What is the _isMexican boolean for in the Global::Checkpower method?
AlwaysOnTop property not behaving properly
Boolean AND logic in Microsoft Dynamics AX 2012 AIF QueryCriteria
Table: PrintMgmtSettings Field: Printjobsettings(Blob)
What happened to the hrplimittablerelationship table in ax-2012-r2?
Why is my changes ignored to releaseupdate scripts in dynamics ax 2012 r2
What is “old sys” exactly and why would I receive errors in 2012 because of a missing Macro?
How to filter records in line grid based on selected record in header grid?
Dynamic linking gets cleared when inserting new records
Box::info showing “refreshEx”
How to filter lookup values on a dialogfield in Report Dialog based on another dialogfield in AX 2012 AOT reports?
Adding scrollbar to a Group in AX 2012 form
Table query inconsistent
AX2012 Sales Order Creation through AX Classes
How can I loop over Tables which contain specific characters in their AOT name and delete the data?

Categories

HOME
batch-file
url-redirection
assembly
gridview
cheerio
phpmyadmin
youtube-data-api-v3
static
database-normalization
entity-framework-core
iis-6
banner
jtextpane
opengl-3
nstableheaderview
dkim
endeca
ibeacon-android
distribution
github-enterprise
siddhi
project-intu
alamofire
enterprise-architect
atlassian
mathprog
bourbon
drive
draft-js-plugins
tiki-wiki
send
postback
testbed
memory-address
biztalk-rule-engine
hibernate-search
nested-lists
spring-mvc-test
setup.py
tasm
stringtokenizer
claims
activeperl
manova
bluez
reindex
jqchart
seq
flex-monkey
envi
mta
model-associations
scaffolding
android-dateutils
swizzling
cassia
angular-ui-typeahead
ellucian-scribe
realsense
maybe
vigenere
jdi
xvim
opserver
fits
openbabel
paw
ignite-ui
build-script
personalization
dct
cnf
node-blade
abstract-data-type
cascadingdropdown
chart-director
http-status-code-410
vfs
iboutlet
appjs
azman
failing-tests
isa-swizzling
node-redis
automationelement
umra
globals
data-mapping
ifilter
cardspace

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App