18 lines
595 B
C#
18 lines
595 B
C#
using System;
|
|
using MagicOnion.Server.Filters;
|
|
|
|
namespace DysonNetwork.Shared.Permission;
|
|
|
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
|
|
public class RequiredPermissionAttribute : MagicOnionFilterAttribute
|
|
{
|
|
public string Scope { get; }
|
|
public string Permission { get; }
|
|
|
|
public RequiredPermissionAttribute(string scope, string permission) : base(typeof(MagicOnionPermissionFilter))
|
|
{
|
|
Scope = scope;
|
|
Permission = permission;
|
|
Order = 999; // Ensure this runs after authentication filters
|
|
}
|
|
} |