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

How can you get a detailed error descriptions in Dynamics AX?
How to get the length of an array?
X++ loop through lines in grid control
Concatenating row values in x++
How do you access a macro in the AOT macro node?
How can I set the Backgoundcolor of an AX2012 Action Pane Button
How to Edit address using X++ in AX 2012
Number sequence issue Ax 2012?
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?

Categories

HOME
windows
jpa
awk
github-for-windows
ecmascript-6
zend-framework
numbers
themes
sh
edge
emscripten
pyqt4
nuget-package
python-multithreading
owin
plist
mautic
x-cart
speech-synthesis
plink
keytool
standards
chargify
soci
bourbon
tosca
mount
gpio
oculus
intersystems-cache
bringtofront
winpe
realm-mobile-platform
twiml
mobx
postback
complex-numbers
record
android-maps-extensions
instantiation
getpixel
installscript
fiware-cygnus
google-earth-engine
dm-script
nohup
c9.io
android-exoplayer
identification
backbone-collections
payload
java-websocket
juice-ui
mongodb-php
tracker-enabled-dbcontext
ikiwiki
atan2
assertion
gocql
themoviedb-api
iokit
vigenere
opserver
batik
uncompress
amiga
botan
osc
umlgraph
dbaccess
showdialog
cosine-similarity
angular-gettext
cancellation
malformedurlexception
xml-dsig
sbcl
high-resolution
gd-graph
modular
tlf
asdf
mantle
apache-abdera
alice
asplinkbutton
sqlclr
boost-msm
multiplexing
oracle-enterprise-linux
httponly
azman
promotion-code
timthumb
svk
photolibrary
updatesourcetrigger
jqueryform
eclipse-marketplace
pos-for-.net
filesystemobject
information-management
httpcookie
mathematical-typesetting

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App