NEVER hardcode security the way Mohd advised…!!! This will fail on the first audit of the system by external auditors… Microsoft did not invent that complex security system in AX 2012 for no reason so that you could start writing code structures like “if( curUserId() == “BOSS”) Object.visible(true);”.
And what if that employee will be fired and new one will come instead? Will you modify then? Will you modify the code in situation which should have been just a pure administrative settings change?
What if there will be 100 users who might need the same access level?? Will you write a huge “IF” statement like this: if (curUserId() == “ABC” || curUserId() == “DEF” || … ) ???
Sorry for being so offensive, but I haven’t said anything wrong…