Example #1
0
        /// <summary>
        /// 清除菜单关联账户的权限缓存
        /// </summary>
        /// <returns></returns>
        private async Task ClearAccountPermissionCache(Guid menuId)
        {
            var relationList = await _accountRoleRepository.QueryByMenu(menuId);

            if (relationList.Any())
            {
                foreach (var relation in relationList)
                {
                    _accountService.ClearPermissionListCache(relation.AccountId);
                }
            }
        }
Example #2
0
        /// <summary>
        /// 清除菜单关联账户的权限缓存
        /// </summary>
        /// <returns></returns>
        private async Task ClearAccountPermissionCache(MenuEntity menu)
        {
            if (menu.Type == MenuType.Route)
            {
                var relationList = await _accountRoleRepository.QueryByMenu(menu.Id);

                if (relationList.Any())
                {
                    foreach (var relation in relationList)
                    {
                        await _accountService.ClearPermissionListCache(relation.AccountId);
                    }
                }
            }
        }