public override void Process(TagHelperContext context, TagHelperOutput output) { string permissionCode = this.Permission; if (string.IsNullOrEmpty(permissionCode)) { return; } bool hasPermission = PermissionCheckHelper.HasPermission(this.ViewContext.HttpContext, new List <string>() { permissionCode }); if (hasPermission) { return; } //没权限则不输出相应的element output.SuppressOutput(); }
public MemoController(ILogger <MemoController> logger, MeshContext meshContext) { _logger = logger; _meshContext = meshContext; _permissionCheck = new PermissionCheckHelper(meshContext); }