MoK: Fehlerhafte Rechteabfrage verhinderte, dass jemand ohne das Recht einen Termin mit Ressourcen einen Termin ohne Ressourcen anzulegen.

Fehlermeldung erscheint, wenn man das Recht "Zeiterfassungseinträge anlegen" nicht hat, da man ohen das Recht den MoK nicht nutzen kann.
This commit is contained in:
2023-09-18 19:39:18 +02:00
parent 0796fa98b1
commit 0ae32f1492
7 changed files with 27 additions and 30 deletions

View File

@@ -248,7 +248,7 @@
<Label Grid.Row="0" Grid.Column="3" Content="Startdatum" VerticalAlignment="Center"/>
<dxe:DateEdit Grid.Row="0" Grid.Column="4" x:Name="KassenBuchStartCB" MaskType="DateTimeAdvancingCaret" Height="23" Margin="3" EditValue="{Binding Path=PreselectedStartDate, RelativeSource={RelativeSource AncestorType={x:Type view:BargeldkassenView}}, Mode=OneWay}" AllowNullInput="False" />
<dxe:DateEdit Grid.Row="0" Grid.Column="4" x:Name="KassenBuchStartCB" MaskType="DateTimeAdvancingCaret" Height="23" Margin="3" EditValue="{Binding Path=PreselectedStartDate, RelativeSource={RelativeSource AncestorType={x:Type view:BargeldkassenView}}, Mode=OneWay}" AllowNullInput="False" />
<Label Grid.Row="0" Grid.Column="5" Content="Enddatum" VerticalAlignment="Center"/>
<dxe:DateEdit Grid.Row="0" Grid.Column="6" x:Name="KassenBuchEndCB" MaskType="DateTimeAdvancingCaret" Height="23" Margin="3" EditValue="{Binding Path=PreselectedEndDate, RelativeSource={RelativeSource AncestorType={x:Type view:BargeldkassenView}}, Mode=OneWay}" AllowNullInput="False"/>

View File

@@ -48,8 +48,15 @@ namespace BeWoPlanerMobil.Controllers
Log.Info($"LoginController.Index(): Loggedin User: {MobileSessionFacade.LoggedInUser.LoginName}");
if(!MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecordView_View))) &&
!MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ViewAll))))
var viewServiceRecords = AbstractModel.HasRightToSeeServiceRecords;//AbstractModel.CheckRight(UserRightType.ServiceRecordView_View);
var viewAll = AbstractModel.CheckRight(UserRightType.ViewAll);
var user = UserService.LoadUser(MobileSessionFacade.LoggedInUser.Oid.Value);
var userGroups = user.UserGroups;
//if(!MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecordView_View))) &&
// !MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ViewAll))))
if(!viewServiceRecords && !viewAll)
{
ViewData[LoginErrorIndex] = HttpUtility.HtmlDecode("Sie haben keine ausreichenden Berechtigungen, um die Zeiterfassung anzeigen zu lassen.");
MobileSessionFacade.LogUserOut();

View File

@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Windows.Forms;
using BeWo.Data.Entities;
@@ -85,7 +86,7 @@ namespace BeWoPlanerMobil.Controllers
{
try
{
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.HasRightToSeeServiceRecords)
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
{
var isNewSession = Session.IsNewSession;

View File

@@ -600,32 +600,15 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public string CheckResourcesAvailability(string start, string end, string resourceOids, bool allDay)
{
if(!AbstractModel.HasRightToInsertRessourceAppointments)
{
return "Fehler!Sie haben nicht das Recht, Termine mit Ressourcen anzulegen!";
}
if(string.IsNullOrWhiteSpace(start) || string.IsNullOrWhiteSpace(end) || string.IsNullOrWhiteSpace(resourceOids) || Model is null)
{
return LeerzeichenFuerGetMethoden;
}
// ALT!
//var oidList = ConvertOidStringToList(resourceOids);
//foreach(var oid in oidList)
//{
// if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid)))
// {
// return JsonConvert.SerializeObject(new List<ResourceDC>());
// }
//}
//var dateTimes = ConvertStringDatesToDateTimes(start, end);
//var unavailableResources = KalenderService.CheckResourceAvailability(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid);
//return JsonConvert.SerializeObject(unavailableResources);
if(!AbstractModel.HasRightToInsertRessourceAppointments)
{
return "Fehler!Sie haben nicht das Recht, Termine mit Ressourcen anzulegen!";
}
var oidList = ConvertOidStringToList(resourceOids);

View File

@@ -1,4 +1,5 @@
@model BeWoPlanerMobil.Models.CustomerModel
@using BS.Shared
@model BeWoPlanerMobil.Models.CustomerModel
@*
@@ -106,15 +107,20 @@
<div class="card-body">
<div class="container-fluid px-0">
@{
var kassenbestand = "Kommt noch!";
var anfangsbestand = bargeldkasse.Anfangsbestand?.ToString("#.## €") ?? "0,00 €";
var einzahlungen = bargeldkasse.Bargeldtransaktionen.Where(bkt => bkt.Zahlungstyp == Zahlungstyp.Einzahlung).Sum(bkt => bkt.Betrag) ?? 0m;
var auszahlungen = bargeldkasse.Bargeldtransaktionen.Where(bkt => bkt.Zahlungstyp == Zahlungstyp.Auszahlung).Sum(bkt => bkt.Betrag) ?? 0m;
var kassenbestand = ((bargeldkasse.Anfangsbestand ?? 0m) + einzahlungen - auszahlungen).ToString("#.## €");
}
<div class="row">
<div class="col-auto mr-auto text-secondary">
Kassenbestand:
</div>
<div class="col-auto">
@kassenbestand
</div>
</div>
<div class="row">

View File

@@ -53,7 +53,7 @@
{
<div class="form-group">
<label for="pinFormControl">PIN</label>
<input id="pinFormControl" name="tb_pin" type="text" class="form-control" placeholder="PIN" />
<input id="pinFormControl" name="tb_pin" type="text" class="form-control" placeholder="PIN"/>
</div>
}

View File

@@ -314,7 +314,7 @@ namespace BeWo.Service.Plugins
//t = "4858885375"; // BewoTrio
//t = "9734214365"; // Wegfinder Rhein-Ruhr
//t = "1011478760"; // Autismus Köln/Bonn e.V.
//t = "8184278271"; // Ambulant Betreutes Wohnen Stephan Schillings
t = "8184278271"; // Ambulant Betreutes Wohnen Stephan Schillings
//t = "2576513996"; // TRIAS Ambulante Sozialarbeit Schön + Schön-Uhlmann GbR
//t = "9518001524"; // Sozialpädagogische Praxis Astrid Schnödewind
//t = "1048483934"; // Frauenhaus e.V. EWFRA - Wohnprojekt für Frauen