| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- namespace IwbZero.Authorization.Base.Permissions
- {
- /// <summary>
- /// Represents a permission <see cref="Name"/> with <see cref="IsGranted"/> information.
- /// </summary>
- public class PermissionGrantInfo
- {
- /// <summary>
- /// Name of the permission.
- /// </summary>
- public string Name { get; private set; }
- /// <summary>
- /// OperType
- /// </summary>
- public int OperType { get; private set; }
- /// <summary>
- /// DataKey
- /// </summary>
- public string DataKey { get; private set; }
- /// <summary>
- /// Is this permission granted Prohibited?
- /// </summary>
- public bool IsGranted { get; private set; }
- /// <summary>
- /// Creates a new instance of <see cref="PermissionGrantInfo"/>.
- /// </summary>
- /// <param name="name"></param>
- /// <param name="isGranted"></param>
- public PermissionGrantInfo(string name, bool isGranted)
- {
- Name = name;
- IsGranted = isGranted;
- }
- /// <summary>
- /// Creates a new instance of <see cref="PermissionGrantInfo"/>.
- /// </summary>
- public PermissionGrantInfo(string name, int? operType, string dataKey, bool isGranted) : this(name, isGranted)
- {
- OperType = operType ?? 0;
- DataKey = dataKey;
- }
- /// <summary>
- /// Creates a new instance of <see cref="PermissionGrantInfo"/>.
- /// </summary>
- 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,
- }
- }
|