Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public async Task <RolePermissionDto> GetRolePermissions(int roleId)
        {
            var permisMenus      = (await _rolePermissionRepository.GetPermissionByRole(roleId, SysConst.MENU)).ToList();
            var permisOperations = (await _rolePermissionRepository.GetPermissionByRole(roleId, SysConst.OPERATION)).ToList();
            var result           = new RolePermissionDto
            {
                PermissionMenuIds      = permisMenus.Select(p => p.Id).ToList(),
                PermissionOperationIds = permisOperations.Select(p => p.Id).ToList()
            };

            return(result);
        }