Grundrisse Rechte

This commit is contained in:
2024-09-20 13:23:52 +02:00
parent 30bf436a88
commit f79cfff8ec
6 changed files with 15 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
<Setter Property="Margin" Value="3" />
<Setter Property="Padding" Value="3" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="TextElement.Foreground" Value="#FF000000" />
</Style>
<Style x:Key="Header1" TargetType="Label">

View File

@@ -26,6 +26,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedIndex="0"
ContextMenuOpening="PhotosListBox_ContextMenuOpening"
Style="{StaticResource PhotoListBox}">
<ListBox.ContextMenu>
<ContextMenu>

View File

@@ -1,6 +1,7 @@
using BeWo.Core;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using System;
using System.Collections.Generic;
using System.IO;
@@ -24,6 +25,8 @@ namespace BeWo.View.Detail.Wohneinheit
/// </summary>
public partial class WohneinheitGrundrissControl : UserControl
{
public bool PermissionWohneinheitGalleryManage { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Gallery_Manage);
public ImageListVM ViewModel => DataContext as ImageListVM;
public WohneinheitGrundrissControl()
@@ -83,5 +86,11 @@ namespace BeWo.View.Detail.Wohneinheit
}
}
}
}
private void PhotosListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
if (!PermissionWohneinheitGalleryManage)
e.Handled = true;
}
}
}

View File

@@ -255,7 +255,7 @@
Text="{Binding Path=Zusatznotiz, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</GroupBox>
<local:WohneinheitGrundrissControl DataContext="{Binding ImageListVM}" />
<local:WohneinheitGrundrissControl Visibility="{Binding Path=DataContext.PermissionWohneinheitGalleryView, ElementName=root_grid,Converter={StaticResource BoolVisibilityConverter}}" DataContext="{Binding ImageListVM}" />
</StackPanel>
</ScrollViewer>

View File

@@ -1,4 +1,5 @@
using BS.Shared.DataContracts;
using BS.Shared;
using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@@ -20,7 +20,6 @@ namespace BeWo.ViewModel.ListViewModel
public bool PermissionWohneinheitManage { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Manage);
public bool PermissionWohneinheitGalleryView { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Gallery_View);
public bool PermissionWohneinheitGalleryManage { get; } = BeWoApp.HasLoggedOnUserRight(UserRightType.WohnheimView_Wohneinheit_Gallery_Manage);
/// <summary>
/// Designer