namespace IwbZero.Authorization.Base.Permissions
{
///
/// Represents a permission with information.
///
public class PermissionGrantInfo
{
///
/// Name of the permission.
///
public string Name { get; private set; }
///
/// OperType
///
public int OperType { get; private set; }
///
/// DataKey
///
public string DataKey { get; private set; }
///
/// Is this permission granted Prohibited?
///
public bool IsGranted { get; private set; }
///
/// Creates a new instance of .
///
///
///
public PermissionGrantInfo(string name, bool isGranted)
{
Name = name;
IsGranted = isGranted;
}
///
/// Creates a new instance of .
///
public PermissionGrantInfo(string name, int? operType, string dataKey, bool isGranted) : this(name, isGranted)
{
OperType = operType ?? 0;
DataKey = dataKey;
}
///
/// Creates a new instance of .
///
public PermissionGrantInfo(string name, OperType operType, string dataKey, bool isGranted) : this(name, (int)operType, dataKey, isGranted)
{
}
}
public enum OperType
{
All = 1,
Create = 2,
Update = 3,
Delete = 4,
Query = 5,
}
}