Toosame.ManagementKit 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Toosame.ManagementKit --version 1.0.0                
NuGet\Install-Package Toosame.ManagementKit -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Toosame.ManagementKit" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Toosame.ManagementKit --version 1.0.0                
#r "nuget: Toosame.ManagementKit, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Toosame.ManagementKit as a Cake Addin
#addin nuget:?package=Toosame.ManagementKit&version=1.0.0

// Install Toosame.ManagementKit as a Cake Tool
#tool nuget:?package=Toosame.ManagementKit&version=1.0.0                

Toosame.ManagementKit

/// <summary>
    /// 系统菜单管理
    /// </summary>
    [ApiController]
    [Route("api/System/[controller]")]
    [MenuPath("/系统管理/菜单管理")]
    public class MenuController : ControllerBase
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly MenuPermissionManager _menuPermissionManager;

        public MenuController(IHttpContextAccessor httpContextAccessor,
            MenuPermissionManager menuPermissionManager)
        {
            _httpContextAccessor = httpContextAccessor;
            _menuPermissionManager = menuPermissionManager;
        }

        /// <summary>
        /// 获取系统菜单和权限树数据
        /// </summary>
        /// <returns></returns>
        [HttpGet, MenuAuditName("获取系统菜单和权限树")]
        public ActionResult<IEnumerable<MenuPermissonTreeNode>> Get()
        {
            return _menuPermissionManager.MenuPermissonTree.ToList();
        }

        /// <summary>
        /// 根据用户获取菜单列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("User"), MenuAuditName("获取当前登录用户菜单树")]
        public ActionResult<IEnumerable<MenuPermissonTreeNode>> GetUserMenu()
        {
            string[] permission = _httpContextAccessor.HttpContext.User
                .FindAll(p => p.Type == nameof(MenuPermissonKind.Permisson))
                .Select(p => p.Value)
                .ToArray();
            if (!permission.Any())
                return Forbid();

            return _menuPermissionManager.GetTree(permission);
        }
    }
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 462 7/1/2022
1.0.0 412 12/14/2020