change name
This commit is contained in:
parent
2879b013ce
commit
6ef25b139c
|
|
@ -9,7 +9,7 @@ public interface IUserService
|
|||
Task<User> GetUser(string id);
|
||||
Task<PagedItems<User>> GetUsers(UserFilter filter);
|
||||
Task<User?> GetUserDetails(string userId);
|
||||
Task<bool> IsAuthorizedUser(string userId);
|
||||
Task<bool> IsAdminUser(string userId);
|
||||
Task<UserAuthorization> GetUserAuthorizations(IEnumerable<string>? agentIds = null);
|
||||
Task<bool> UpdateUser(User user, bool isUpdateUserAgents = false);
|
||||
Task<User> CreateUser(User user);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using BotSharp.Abstraction.Repositories.Enums;
|
||||
using BotSharp.Abstraction.Users.Enums;
|
||||
using System.IO;
|
||||
|
||||
namespace BotSharp.Core.Agents.Services;
|
||||
|
|
@ -18,7 +17,7 @@ public partial class AgentService
|
|||
}
|
||||
|
||||
var userService = _services.GetRequiredService<IUserService>();
|
||||
var isValid = await userService.IsAuthorizedUser(_user.Id);
|
||||
var isValid = await userService.IsAdminUser(_user.Id);
|
||||
if (!isValid)
|
||||
{
|
||||
return "Unauthorized user.";
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ public class UserService : IUserService
|
|||
return users;
|
||||
}
|
||||
|
||||
public async Task<bool> IsAuthorizedUser(string userId)
|
||||
public async Task<bool> IsAdminUser(string userId)
|
||||
{
|
||||
var db = _services.GetRequiredService<IBotSharpRepository>();
|
||||
var user = db.GetUserById(userId);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,6 @@ public class PluginController : ControllerBase
|
|||
private async Task<bool> IsValidUser()
|
||||
{
|
||||
var userService = _services.GetRequiredService<IUserService>();
|
||||
return await userService.IsAuthorizedUser(_user.Id);
|
||||
return await userService.IsAdminUser(_user.Id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,6 @@ public class RoleController : ControllerBase
|
|||
private async Task<bool> IsValidUser()
|
||||
{
|
||||
var userService = _services.GetRequiredService<IUserService>();
|
||||
return await userService.IsAuthorizedUser(_user.Id);
|
||||
return await userService.IsAdminUser(_user.Id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public class UserController : ControllerBase
|
|||
private async Task<bool> IsValidUser()
|
||||
{
|
||||
var userService = _services.GetRequiredService<IUserService>();
|
||||
return await userService.IsAuthorizedUser(_user.Id);
|
||||
return await userService.IsAdminUser(_user.Id);
|
||||
}
|
||||
|
||||
private FileContentResult BuildFileResult(string file)
|
||||
|
|
|
|||
Loading…
Reference in a new issue