Example #1
0
        public bool IsGroupTypePermissionInherited(string type, string permissionName, Group g)
        {
            bool ival = GetGroupTypePermissionInherited(type, permissionName, g);
            bool val = GetGroupTypePermission(type, permissionName, g);

            //forciere Cleaning
            SetGroupTypePermission(type, permissionName, val, g);

            return ival == val;
        }
Example #2
0
File: User.cs Project: hmehr/OSS
 public void RemoveFromGroup(Group group)
 {
     Groups.Remove(group);
 }
Example #3
0
 public bool IsGroupObjectPermissionInherited(object o, string permissionName, Group group)
 {
     bool ival = GetGroupObjectPermissionInherited(o, permissionName, group);
     bool val = GetGroupObjectPermission(o, permissionName, group);
     //forciere Cleaning
     SetGroupObjectTypePermission(o, permissionName, val, group);
     return ival == val;
 }
Example #4
0
        private bool GetGroupObjectPermission(object o, string permission, Group group)
        {
            string locator = GetLocator(o);
            string type = o.GetType().FullName;
            object parent = GetParent(o);
            string parentLocator = null;
            if (parent != null)
                parentLocator = GetLocator(parent);
            string parentType = null;
            if (parent != null)
                parentType = parent.GetType().FullName;

            bool? access = _DataAdapter._GetPermissionOfGroupObjectPermissionList(locator, type, permission, group.Id);
            if (access != null) return access.Value;

            return GetGroupObjectPermissionInherited(o, permission, group);
        }
Example #5
0
        private bool GetGroupTypePermission(string type, string permissionName, Group g)
        {
            bool? access = _DataAdapter._GetPermissionOfGroupTypePermissionList(type, permissionName, g.Id);
            if (access != null) return access.Value;

            return GetGroupTypePermissionInherited(type, permissionName, g);
        }
Example #6
0
 public void ResetGroupTypePermission(string type, Group group)
 {
     _DataAdapter._ResetGroupTypePermission(type, group.Id);
 }
Example #7
0
 public void SetGroupTypePermission(string type, string permissionName, bool access, Group g)
 {
     //Wenn Gruppe mit Inherited übereinstimmt, dann Wert aus der Liste streichen
     if (GetGroupTypePermissionInherited(type, permissionName, g) == access)
     {
         _DataAdapter._RemoveGroupTypePermission(type, permissionName, g.Id);
     }
     else
     {
         if (GetGroupTypePermission(type, permissionName, g) != access)
             //ansonsten hinzufügen
             _DataAdapter._AddGroupTypePermission(type, permissionName, access, g.Id);
     }
 }
Example #8
0
 private bool CanRenameGroupCommand(Group obj)
 {
     return true;
 }
Example #9
0
 private void ExecuteRemoveGroupCommand(Group obj)
 {
     try
     {
         if (MessageBox.Show("Do you really want to delete this group?", "Delete Group", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             RemoveGroup(obj);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     RaiseCanExecuteChanged();
 }
Example #10
0
 public void AddGroupToList(Group group)
 {
     GroupMembershipInfo gmi = new GroupMembershipInfo(group, this.User);
     gmi.PropertyChanged += gmi_PropertyChanged;
     Groups.Add(gmi);
 }
Example #11
0
 public void RemoveGroupFromList(Group group)
 {
     try
     {
         GroupMembershipInfo gmi = Groups.First(gi => gi.Group.Name == group.Name);
         if (gmi == null)
             return;
         gmi.PropertyChanged -= gmi_PropertyChanged;
         Groups.Remove(gmi);
     }
     catch (Exception exp) { Trace.WriteLine(exp.ToString()); }
 }
Example #12
0
 public GroupMembershipInfo(Group group, User user)
 {
     Group = group;
     User = user;
 }
Example #13
0
 public GroupInfo(Group g, Framework fw)
 {
     Group = g;
     _Framework = fw;
 }
Example #14
0
        private void RemoveGroup(Group g)
        {
            try
            {
                SecurityFramework.RemoveGroup(g);

                if (_Groups.Contains(g))
                    _Groups.Remove(g);
                _Users.ToList().ForEach(u => u.RemoveGroupFromList(g));
                UpdateGroupFilter();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #15
0
 public void RemoveGroup(Group g)
 {
     _DataAdapter._RemoveGroup(g);
 }
Example #16
0
 private void ExecuteRenameGroupCommand(Group obj)
 {
     try
     {
         EditStringWindow dlg = new EditStringWindow();
         dlg.Title = "Rename Group";
         dlg.Header = "Enter new group name for: " + obj.Name;
         dlg.TextItem = obj.Name;
         dlg.Owner = Application.Current.MainWindow;
         dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner;
         if (dlg.ShowDialog() == true)
         {
             obj.Name = dlg.TextItem;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     RaiseCanExecuteChanged();
 }
Example #17
0
 public void ResetGroupObjectPermission(object o, Group group)
 {
     string locator = GetLocator(o);
     string type = o.GetType().FullName;
     _DataAdapter._ResetGroupObjectPermission(locator, type, group.Id);
 }
        public void _RemoveGroup(Group group)
        {
            //1. Löscht Gruppe aus UserGroups
            //2. Entfernt GruppeRelation zu User
            //3. Entfernt aus der TypACL alle Gruppeneinträge
            //4. Entfernt aus der ObjectACL alle Gruppeneinträge

            Adapters.UserGroupsAdapter.RemoveGroup(int.Parse(group.Id));
            Adapters.UserProfiles_UserGroupsAdapter.RemoveEntriesByGroupId(int.Parse(group.Id));
            Reset();
        }
Example #19
0
 public void SetGroupObjectTypePermission(object o, string permissionName, bool access, Group g)
 {
     string locator = GetLocator(o);
     string type = o.GetType().FullName;
     //Wenn als Gruppe schon durch den Typ vererbt, dann braucht es den Eintrag nicht
     if (GetGroupObjectPermissionInherited(o, permissionName, g) == access)
     {
         _DataAdapter._RemoveGroupObjectPermission(locator, type, permissionName, g.Id);
     }
     else
     {
         if (GetGroupObjectPermission(o, permissionName, g) != access)
             _DataAdapter._AddGroupObjectPermission(locator, type, permissionName, access, g.Id);
     }
 }
 public void _UpdateGroup(Group group)
 {
     Adapters.UserGroupsAdapter.UpdateGroup(int.Parse(group.Id), group.Name);
     Reset();
 }
Example #21
0
 public void UpdateGroup(Group g)
 {
     _DataAdapter._UpdateGroup(g);
 }
Example #22
0
 public List<PermissionInfo> GetGroupObjectPermissions(object o, Group group)
 {
     List<PermissionInfo> pis = new List<PermissionInfo>();
     string type = o.GetType().FullName;
     TypeInfo ti = GetTypeInfoByTypeName(type);
     foreach (PermissionInfo pi in ti.Permissions)
     {
         bool access = GetGroupObjectPermission(o, pi.PermissionName, group);
         pis.Add(new PermissionInfo(pi.PermissionName, access));
     }
     return pis;
 }
Example #23
0
        private bool GetGroupObjectPermissionInherited(object o, string permission, Group group)
        {
            string locator = GetLocator(o);
            string type = o.GetType().FullName;
            object parent = GetParent(o);
            string parentLocator = null;
            if (parent != null)
                parentLocator = GetLocator(parent);
            string parentType = null;
            if (parent != null)
                parentType = parent.GetType().FullName;

            bool? access = null;

            //Wenn ein Object ein Parent, dann diese noch berücksichtigen = > aber nur eine Stufe!
            if (parent != null && parentLocator != null)
            {
                access = _DataAdapter._GetPermissionOfGroupObjectPermissionList(parentLocator, type, permission, group.Id);
                if (access != null) return access.Value;
            }

            //Group Type?
            access = _DataAdapter._GetPermissionOfGroupTypePermissionList(type, permission, group.Id);
            if (access != null) return access.Value;

            if (parentType != null)
            {
                access = _DataAdapter._GetPermissionOfGroupTypePermissionList(parentType, permission, group.Id);
                if (access != null) return access.Value;
            }

            return GetDefaultPermissionOfType(type, permission);
        }
Example #24
0
 public List<PermissionInfo> GetGroupTypePermissions(string type, Group g)
 {
     List<PermissionInfo> pis = new List<PermissionInfo>();
     TypeInfo ti = GetTypeInfoByTypeName(type);
     foreach (PermissionInfo pi in ti.Permissions)
     {
         bool access = GetGroupTypePermission(type, pi.PermissionName, g);
         pis.Add(new PermissionInfo(pi.PermissionName, access));
     }
     return pis;
 }
Example #25
0
        private bool GetGroupTypePermissionInherited(string type, string permissionName, Group g)
        {
            bool? access = null;

            TypeInfo ti = GetTypeInfoByTypeName(type);
            if (ti != null && ti.HierachicalParent != null)
            {
                string hierachicalParentType = ti.HierachicalParent.Name;
                access = _DataAdapter._GetPermissionOfGroupTypePermissionList(hierachicalParentType, permissionName, g.Id);
            }
            if (access != null) return access.Value;

            return GetDefaultPermissionOfType(type, permissionName);
        }
Example #26
0
File: User.cs Project: hmehr/OSS
 public void AddToGroup(Group group)
 {
     if (Groups.Contains(group)) return;
     Groups.Add(group);
 }