Permessi_Parziale
This commit is contained in:
21
StandManager.Domain/Entita/Feature.cs
Normal file
21
StandManager.Domain/Entita/Feature.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
public class Feature : EntitaBase
|
||||
{
|
||||
public string Nome { get; set; }
|
||||
public string Descrizione { get; set; }
|
||||
public int Ordinamento { get; set; }
|
||||
public Sezione Sezione { get; set; }
|
||||
public FeatureType Type { get; set; }
|
||||
}
|
||||
|
||||
public enum FeatureType
|
||||
{
|
||||
Any = -99,
|
||||
Insert = 0,
|
||||
Edit,
|
||||
Delete,
|
||||
AdminGlobal = 100
|
||||
}
|
||||
14
StandManager.Domain/Entita/Permission.cs
Normal file
14
StandManager.Domain/Entita/Permission.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
public class Permission : EntitaBase
|
||||
{
|
||||
[ForeignKey(nameof(Ruolo))]
|
||||
public Guid? RuoloId { get; set; }
|
||||
public Ruolo Ruolo { get; set; }
|
||||
[ForeignKey(nameof(Feature))]
|
||||
public Guid IdFeature { get; set; }
|
||||
public Feature Feature { get; set; }
|
||||
}
|
||||
@ -12,11 +12,11 @@ public class Referente : EntitaBase
|
||||
public string Cognome { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public Ruolo Ruolo { get; set; }
|
||||
public RuoloReferente Ruolo { get; set; }
|
||||
public string RuoloNote { get; set; }
|
||||
}
|
||||
|
||||
public enum Ruolo
|
||||
public enum RuoloReferente
|
||||
{
|
||||
Ruolo1 = 0,
|
||||
Ruolo2,
|
||||
|
||||
19
StandManager.Domain/Entita/Ruolo.cs
Normal file
19
StandManager.Domain/Entita/Ruolo.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
public class Ruolo : EntitaBase
|
||||
{
|
||||
public Ruolo()
|
||||
{
|
||||
Nome = string.Empty;
|
||||
}
|
||||
public string Nome { get; set; }
|
||||
|
||||
[InverseProperty(nameof(Utente.Ruolo))]
|
||||
public List<Utente> Utenti { get; set; }
|
||||
|
||||
[InverseProperty(nameof(Permission.Ruolo))]
|
||||
public virtual List<Permission> Permessi { get; set; }
|
||||
}
|
||||
12
StandManager.Domain/Entita/Sezione.cs
Normal file
12
StandManager.Domain/Entita/Sezione.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
public class Sezione : EntitaBase
|
||||
{
|
||||
public string Nome { get; set; }
|
||||
public int Ordinamento { get; set; }
|
||||
[InverseProperty(nameof(Feature.Sezione))]
|
||||
public List<Feature> Features { get; set; }
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
@ -16,6 +17,10 @@ public class Utente : EntitaBase
|
||||
public string Nome { get; set; }
|
||||
public string Cognome { get; set; }
|
||||
public string? CodiceAgente { get; set; }
|
||||
[ForeignKey(nameof(Ruolo))]
|
||||
public Guid? RuoloId { get; set; }
|
||||
public Ruolo Ruolo { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Nome} {Cognome}";
|
||||
|
||||
Reference in New Issue
Block a user