Пример #1
0
        /// <summary>
        /// Add or removes the selected user from AAD groups.
        ///
        /// Calls SetGroups and SetDepartments (actually the same methods, need to refactor) for updating the users membership via webhooks.
        ///
        /// </summary>
        /// <param name="groupuser"></param>
        /// <param name="requestByUser"></param>
        /// <returns></returns>
        public async Task <string> ProcessUserGroupsEdits(GroupUser groupuser, string requestByUser)
        {
            var current = await _aadCollector.LoadGroupMembershipsForGroupsFromBlob();

            await SetGroups(groupuser, requestByUser, current);
            await SetDepartments(groupuser, requestByUser, current);

            return(null);
        }
        public async Task <ActionResult> Index()
        {
            try
            {
                var GroupCollection = await _aadCollector.LoadGroupMembershipsForGroupsFromBlob();

                var user = new User();
                ViewBag.GroupList       = GroupCollection.GroupList;
                ViewBag.ApplicationName = _appSettings.ApplicationName;

                return(View());
            }
            catch (Exception e)
            {
                _logger.LogError(8, e, "GroupController");
                TempData["message"] = e.ToString();
                return(RedirectToAction("Error"));
            }
        }