12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using Luticate2.Auth.Attributes.EntityAccessors;
- using Luticate2.Auth.Dbo.Permissions;
-
- namespace Luticate2.Auth.Attributes
- {
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
- public class LuPermissionAttribute : Attribute
- {
- public string PermissionName { get; protected set; }
-
- public string SrcEntityType { get; protected set; }
-
- public Type SrcEntityAccessor { get; protected set; }
-
- public string DstEntityType { get; protected set; }
-
- public Type DstEntityAccessor { get; protected set; }
-
- public object Id { get; protected set; }
-
- public LuPermissionAttribute(string permissionName, string srcEntityType, Type srcEntityAccessor,
- string dstEntityType, Type dstEntityAccessor, object id = null)
- {
- PermissionName = permissionName;
- SrcEntityType = srcEntityType;
- SrcEntityAccessor = srcEntityAccessor;
- DstEntityType = dstEntityType;
- DstEntityAccessor = dstEntityAccessor;
- Id = id;
- }
-
- public LuPermissionAttribute(string permissionName, string dstEntityType, Type dstEntityAccessor, object id = null)
- : this(permissionName, LuEntityTypes.LuUsers, typeof(LuAttrLoggedUserAccessor), dstEntityType, dstEntityAccessor, id)
- {
- }
-
- public LuPermissionAttribute(string permissionName, string dstEntityType, object id = null)
- : this(permissionName, dstEntityType, typeof(LuAttrArgumentAccessor), id)
- {
- }
- }
- }
|