我正在用AX2009写一份报告,它将显示用户有什么权限,我的问题是,
如果x++获得了发布移动日志的许可,我如何通过代码(在user1中)查找?
谢谢
发布于 2014-05-29 16:41:02
请看一下SecurityKeySet类。
例如,要检查用户是否有权访问菜单项InventJournalPost:
SecurityKeySet userRights;
MenuFunction inventJournalPostFunction;
AccessType functionAccess;
boolean canPost;
;
userRights = new SecurityKeySet();
userRights.loadUserRights(curuserid()); // or any other user ID
inventJournalPostFunction = new MenuFunction(
menuitemactionstr(InventJournalPost),
MenuItemType::Action);
functionAccess = userRights.menuItemAccess(
inventJournalPostFunction.name(),
AccessRecordType::MenuItemAction);
canPost = (functionAccess >= inventJournalPostFunction.neededAccessLevel());
info(strfmt("User %1 post inventory journals", canPost ? "can" : "can not"));https://stackoverflow.com/questions/23937986
复制相似问题