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; }
public void RemoveFromGroup(Group group) { Groups.Remove(group); }
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; }
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); }
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); }
public void ResetGroupTypePermission(string type, Group group) { _DataAdapter._ResetGroupTypePermission(type, group.Id); }
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); } }
private bool CanRenameGroupCommand(Group obj) { return true; }
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(); }
public void AddGroupToList(Group group) { GroupMembershipInfo gmi = new GroupMembershipInfo(group, this.User); gmi.PropertyChanged += gmi_PropertyChanged; Groups.Add(gmi); }
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()); } }
public GroupMembershipInfo(Group group, User user) { Group = group; User = user; }
public GroupInfo(Group g, Framework fw) { Group = g; _Framework = fw; }
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); } }
public void RemoveGroup(Group g) { _DataAdapter._RemoveGroup(g); }
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(); }
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(); }
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(); }
public void UpdateGroup(Group g) { _DataAdapter._UpdateGroup(g); }
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; }
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); }
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; }
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); }
public void AddToGroup(Group group) { if (Groups.Contains(group)) return; Groups.Add(group); }