コード例 #1
0
        private void save()
        {
            var grants = PrivilegeList.Where(p => p.IsGrant).Select(p => p.ActionType).ToDictionary(p => (int)p, p => true);
            var denies = PrivilegeList.Where(p => !p.IsGrant).Select(p => p.ActionType).ToDictionary(p => (int)p, p => false);

            foreach (int k in denies.Keys)
            {
                if (!grants.Keys.Contains(k))
                {
                    grants.Add(k, denies[k]);
                }
            }
            if (!IsGroup)
            {
                userService.UpdateUserAccess((res, exp) => appController.BeginInvokeOnDispatcher(() =>
                {
                    if (exp != null)
                    {
                        appController.HandleException(exp);
                    }
                    else
                    {
                        OnRequestClose();
                    }
                }), Party.PartyName, grants);
            }
            //appController.Publish(new UpdatePartyCustomActionsArgs(grants,Party.PartyName));
            //OnRequestClose();
        }