public JsonResult DeleteGroup(string strGroupId)
        {
            try
            {
                string[] strGroup = strGroupId.Split(',');
                strGroupId = string.Empty;
                foreach (var item in strGroup)
                {
                    strGroupId += item.Trim() + ",";
                }

                strGroupId = strGroupId.Substring(0, strGroupId.Length - 1);
                DeleteGroupResult result = this.objiClsGroup.DeleteGroup(strGroupId, mySession.Current.UserId);
                if (result != null && result.TotalReference == 0)
                {
                    return(this.Json(Functions.AlertMessage("Group", MessageType.DeleteSucess)));
                }
                else if (result != null && result.TotalReference > 0)
                {
                    return(this.Json(Functions.AlertMessage("Group", MessageType.DeletePartial, result.Name)));
                }

                return(this.Json(Functions.AlertMessage("Group", MessageType.DeleteFail)));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Group, mySession.Current.UserId);
                return(this.Json(Functions.AlertMessage("Group", MessageType.DeleteFail)));
            }
        }
Exemple #2
0
        public async Task UnsyncGroupAsync(Guid groupId, Guid scimAppSettingsId)
        {
            ScimGroupSyncState syncState = await _authDbContext
                                           .ScimGroupSyncStates
                                           .SingleAsync(s => s.SCIMAppSettings.Id == scimAppSettingsId && s.UserGroup.Id == groupId);

            Gatekeeper.SCIM.Client.Client scimClient = await GetScimClient(scimAppSettingsId);

            DeleteGroupAction deleteGroup       = new DeleteGroupAction(syncState.ServiceId);
            DeleteGroupResult deleteGroupResult = await scimClient.PerformAction <DeleteGroupResult>(deleteGroup);

            _authDbContext.Remove(syncState);
            await _authDbContext.SaveChangesAsync();
        }
        public async Task <bool> Delete(string groupId, string profileToken)
        {
            DeleteGroupResult res = await Delete <DeleteGroupResult>("/" + groupId, profileToken);

            return(res.Deleted);
        }