You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
using System.Collections.Immutable;
|
|
using Connected.Security;
|
|
using Connected.Security.Identity;
|
|
using Connected.ServiceModel;
|
|
using Connected.Services;
|
|
using Connected.Services.Annotations;
|
|
|
|
namespace Common.Security.Identity;
|
|
|
|
internal class UserService : EntityService<int>, IUserService
|
|
{
|
|
public UserService(IContext context) : base(context)
|
|
{
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityDelete)]
|
|
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
{
|
|
await Invoke(GetOperation<DeleteUser>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityAdd)]
|
|
public async Task<int> Insert(UserInsertArgs args)
|
|
{
|
|
return await Invoke(GetOperation<InsertUser>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
public async Task<ImmutableList<IUser>?> Query()
|
|
{
|
|
return await Invoke(GetOperation<QueryUsers>(), Dto.Empty);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
public async Task<ImmutableList<IUser>?> Query(PrimaryKeyListArgs<int> args)
|
|
{
|
|
return await Invoke(GetOperation<LookupUsers>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
public async Task<IUser?> Resolve(UserResolveArgs args)
|
|
{
|
|
return await Invoke(GetOperation<ResolveUser>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
public async Task<IUser?> Select(PrimaryKeyArgs<int> args)
|
|
{
|
|
return await Invoke(GetOperation<SelectUser>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityModify, SecurityClaims.SecurityModifySelf)]
|
|
public async Task Update(UserUpdateArgs args)
|
|
{
|
|
await Invoke(GetOperation<UpdateUser>(), args);
|
|
}
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityModify, SecurityClaims.SecurityModifySelf)]
|
|
public async Task UpdatePassword(UserPasswordArgs args)
|
|
{
|
|
await Invoke(GetOperation<UserUpdatePassword>(), args);
|
|
}
|
|
}
|