enhance UserRole service with filtering and moved workload to server for better performance, improve error message details during installation
This commit is contained in:
		| @ -16,6 +16,31 @@ namespace Oqtane.Services | ||||
|         /// <returns></returns> | ||||
|         Task<List<UserRole>> GetUserRolesAsync(int siteId); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Get all <see cref="UserRole"/>s on a <see cref="Site"/> | ||||
|         /// </summary> | ||||
|         /// <param name="siteId">ID-reference to a <see cref="Site"/></param> | ||||
|         /// <param name="userId">ID-reference to a <see cref="User"/></param> | ||||
|         /// <returns></returns> | ||||
|         Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Get all <see cref="UserRole"/>s on a <see cref="Site"/> | ||||
|         /// </summary> | ||||
|         /// <param name="siteId">ID-reference to a <see cref="Site"/></param> | ||||
|         /// <param name="roleName">Name reference a <see cref="Role"/></param> | ||||
|         /// <returns></returns> | ||||
|         Task<List<UserRole>> GetUserRolesAsync(int siteId, string roleName); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Get all <see cref="UserRole"/>s on a <see cref="Site"/> | ||||
|         /// </summary> | ||||
|         /// <param name="siteId">ID-reference to a <see cref="Site"/></param> | ||||
|         /// <param name="userId">ID-reference to a <see cref="User"/></param> | ||||
|         /// <param name="roleName">Name reference a <see cref="Role"/></param> | ||||
|         /// <returns></returns> | ||||
|         Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId, string roleName); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Get one specific <see cref="UserRole"/> | ||||
|         /// </summary> | ||||
|  | ||||
| @ -16,7 +16,31 @@ namespace Oqtane.Services | ||||
|  | ||||
|         public async Task<List<UserRole>> GetUserRolesAsync(int siteId) | ||||
|         { | ||||
|             return await GetJsonAsync<List<UserRole>>($"{Apiurl}?siteid={siteId}"); | ||||
|             return await GetUserRolesAsync(siteId, -1, ""); | ||||
|         } | ||||
|  | ||||
|         public async Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId) | ||||
|         { | ||||
|             return await GetUserRolesAsync(siteId, userId, ""); | ||||
|         } | ||||
|  | ||||
|         public async Task<List<UserRole>> GetUserRolesAsync(int siteId, string roleName) | ||||
|         { | ||||
|             return await GetUserRolesAsync(siteId, -1, roleName); | ||||
|         } | ||||
|  | ||||
|         public async Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId, string roleName) | ||||
|         { | ||||
|             var url = $"{Apiurl}?siteid={siteId}"; | ||||
|             if (userId != -1) | ||||
|             { | ||||
|                 url += $"&userid={userId}"; | ||||
|             } | ||||
|             if (roleName != "") | ||||
|             { | ||||
|                 url += $"&rolename={roleName}"; | ||||
|             } | ||||
|             return await GetJsonAsync<List<UserRole>>(url); | ||||
|         } | ||||
|  | ||||
|         public async Task<UserRole> GetUserRoleAsync(int userRoleId) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker