AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.08.2015, 15:42   #8  
NeveB is offline
NeveB
Участник
 
60 / 16 (1) ++
Регистрация: 14.11.2003
Адрес: Mosсow
пользуюсь следующим методом. единственное, что админы не проходят данную проверку
X++:
static boolean hasAccessToPrivilege(SecurityTaskAotName _privilegeName, UserID _userId = curUserId())
{
    UserInfo                    userInfo;
    SecurityUserRole            securityUserRole;
    SecurityRoleTaskGrant       srtGrant;
    securityRoleExplodedGraph   securityRoleExplodedGraph;
    securityTaskExplodedGraph   securityTaskExplodedGraph;
    SecurityTask                securityTask;

    select firstOnly RecId from securityTask
        where securityTask.AotName == _privilegeName;

    if (securityTask.RecId)
    {
        select RecId from userInfo
            where userInfo.Enable && userInfo.id == _userId
            exists join securityUserRole
            where securityUserRole.User               == userInfo.Id &&
                    securityUserRole.AssignmentStatus == RoleAssignmentStatus::Enabled
            exists join securityRoleExplodedGraph
                where securityUserRole.SecurityRole == securityRoleExplodedGraph.SecurityRole
            exists join srtGrant
                where srtGrant.SecurityRole == securityRoleExplodedGraph.SecuritySubRole
            exists join securityTaskExplodedGraph
                where securityTaskExplodedGraph.SecurityTask      == srtGrant.SecurityTask &&
                        securityTaskExplodedGraph.SecuritySubTask == securityTask.RecId;
    }
    
    return userInfo.RecId != 0;
}
За это сообщение автора поблагодарили: Kabardian (2), АртемМелихов (1).
Теги
ax2012

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
amer-ax: It was a great day! Blog bot DAX Blogs 3 29.12.2012 01:02
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:34.