Exemplo n.º 1
0
        private void Authorize(Credentalis credentalis)
        {
            var result = _authorizeService.Authorize(credentalis);

            if (result.Found)
            {
                _currentUser            = result.CurrentUser;
                UserContext.CurrentUser = result.CurrentUser;
            }
            if (_currentUser != null)
            {
                HasAdminAccess          = _currentUser.RoleID == 4;
                HasModerAccess          = _currentUser.RoleID == 4 || _currentUser.RoleID == 5;
                scheduleMenu.Visibility = HasModerAccess ? Visibility.Visible : Visibility.Collapsed;
                userMenu.Visibility     = HasModerAccess ? Visibility.Visible : Visibility.Collapsed;
                //servicesMenu.Visibility = HasModerAccess ? Visibility.Visible : Visibility.Collapsed;
                //clientMenu.Visibility = HasModerAccess ? Visibility.Visible : Visibility.Collapsed;
                reportMenu.Visibility = HasAdminAccess ? Visibility.Visible : Visibility.Collapsed;
            }
        }