Example #1
0
        /// <summary>
        /// 通过当前用户名与指定菜单路径获取此菜单下所有授权按钮集合 (userName, url, auths) => bool
        /// </summary>
        /// <param name="userName">当前操作用户名</param>
        /// <param name="url">资源按钮所属菜单</param>
        /// <param name="auths">资源授权码</param>
        /// <returns></returns>
        public virtual bool AuthorizateButtons(string userName, string url, string auths)
        {
            var menus = MenuHelper.RetrieveAllMenus(userName);

            return(DbHelper.AuthorizateButtons(menus, url, auths));
        }
Example #2
0
        public void SavaRolesByMenuId_Ok()
        {
            var menuId = MenuHelper.RetrieveAllMenus("Admin").FirstOrDefault().Id;

            Assert.True(RoleHelper.SavaByMenuId(menuId, RoleHelper.Retrieves().Select(r => r.Id)));
        }