Пример #1
0
 public RolesView()
 {
     InitializeComponent();
     if (!Program.AuthUser.Role.Permissions.Any(x => x.Type == Domain.PermissionType.NewRole))
     {
         this.addNewRoleButton.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
     if (!Program.AuthUser.Role.Permissions.Any(x => x.Type == Domain.PermissionType.EditRole))
     {
         this.saveRoleButton.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
     presenter = new RolesPresenter(this);
 }
Пример #2
0
 public RolesView()
 {
     InitializeComponent();
     if (!Program.AuthUser.Role.Permissions.Any(x => x.Type == Domain.PermissionType.NewRole))
     {
         this.addNewRoleButton.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
     if (!Program.AuthUser.Role.Permissions.Any(x => x.Type == Domain.PermissionType.EditRole))
     {
         this.saveRoleButton.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     }
     presenter = new RolesPresenter(this);
     List<CheckedListBoxItem> items = new List<CheckedListBoxItem>();
     foreach (var perm in presenter.Permissions)
     {
         items.Add(new CheckedListBoxItem(perm, perm.Name, false));
     }
     permissionsCheckedListBoxControl.Items.AddRange(items.ToArray());
 }