Esempio n. 1
0
/// <summary>
/// Update the list
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

        private void OkButton_Click(object sender, EventArgs e)
        {
            if (!Editable)
            {
                DialogResult = DialogResult.OK;
                return;
            }

            AccessControlList acl = PermissionsList.GetAcl();

            acl.AddReadWriteUserItem(SS.I.UserName); // be sure current user is included

            Uo.ACL         = acl.Serialize();        // just an ACL, no content
            Uo.AccessLevel = UserObjectAccess.ACL;
            UserObjectDao.Write(Uo, Uo.Id);

            UserGroups.UpdateInMemoryCollection(Uo.Name, acl);
            DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
/// <summary>
/// Save the changes
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

        private void OkButton_Click(object sender, EventArgs e)
        {
            if (!Editable)
            {
                DialogResult = DialogResult.OK;
                return;
            }

            AccessControlList acl = PermissionsList.GetAcl();

            acl.AddReadWriteUserItem(SS.I.UserName);             // be sure owner is included

            if (acl.IsPrivate)
            {
                Uo.AccessLevel = UserObjectAccess.Private;
                Uo.ACL         = "";
            }
            else if (acl.IsPublic)
            {
                Uo.AccessLevel = UserObjectAccess.Public;
                Uo.ACL         = "";
            }
            else
            {
                Uo.AccessLevel = UserObjectAccess.ACL;
                Uo.ACL         = acl.Serialize();
            }

            if (Uo.Id > 0)             // update header if object exists already
            {
                UserObjectDao.UpdateHeader(Uo, false, true);
            }

            DialogResult = DialogResult.OK;
            return;
        }