using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GreenTree.Nachtragsmanagement.Core.Domain.User
{
public class Role : BaseEntity
{
#region Fields
///
/// Users related to the role
///
private ICollection _users;
///
/// Functionlist
///
private ICollection _functions;
#endregion
///
/// Description
///
public string Description { get; set; }
///
/// Level of right (higher value means higher right)
///
public int Level { get; set; }
///
/// Determines if the role can only see sites which it is assigned to
///
public bool SeeOnlyAssigned { get; set; }
///
/// Users assigned to the role
///
public virtual ICollection Users
{
get { return _users ?? (_users = new List()); }
protected set { _users = value; }
}
///
/// Functions the role have
///
public virtual ICollection Functions
{
get { return _functions ?? (_functions = new List()); }
protected set { _functions = value; }
}
#region Helper
///
/// Adds missing functions and removes not selected functions
///
/// Functions.
public void SetFunctions(ICollection functions)
{
Functions = functions;
}
#endregion
}
}