예제 #1
0
        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();
        }
예제 #2
0
 public MemoController(ILogger <MemoController> logger, MeshContext meshContext)
 {
     _logger          = logger;
     _meshContext     = meshContext;
     _permissionCheck = new PermissionCheckHelper(meshContext);
 }