using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LB_SmartVisionCommon
{
///
/// 泛型权限控制特性
///
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class PermissionAttribute : Attribute
{
///
/// 角色
///
public Type RoleType { get; }
///
/// 最小权限
///
public object MinimumRole { get; }
///
/// 泛型权限控制特性
///
/// 角色
/// 最小权限
///
public PermissionAttribute(Type roleType, object minimumRole)
{
if (!roleType.IsEnum)
throw new ArgumentException("roleType 必须是枚举类型", nameof(roleType));
RoleType = roleType;
MinimumRole = minimumRole;
}
}
}