using System.Collections.Immutable; using Connected.Security; using Connected.Security.Permissions; using Connected.ServiceModel; using Connected.Services; using Connected.Services.Annotations; namespace Common.Security.Permissions; internal class PermissionService : EntityService, IPermissionService { public PermissionService(IContext context) : base(context) { } [ServiceAuthorization(SecurityClaims.SecurityDelete)] public async Task Delete(PrimaryKeyArgs args) { await Invoke(GetOperation(), args); } [ServiceAuthorization(SecurityClaims.SecurityAdd)] public async Task Insert(PermissionArgs args) { return await Invoke(GetOperation(), args); } [ServiceAuthorization(SecurityClaims.SecurityRead, Stage = AuthorizationStage.Result)] public async Task?> Query() { return await Invoke(GetOperation(), Dto.Empty); } [ServiceAuthorization(SecurityClaims.SecurityRead, Stage = AuthorizationStage.Result)] public async Task?> Query(PermissionSearchArgs args) { return await Invoke(GetOperation(), args); } [ServiceAuthorization(SecurityClaims.SecurityRead, Stage = AuthorizationStage.Result)] public async Task Select(PrimaryKeyArgs args) { return await Invoke(GetOperation(), args); } [ServiceAuthorization(SecurityClaims.SecurityModify)] public async Task Update(PermissionUpdateArgs args) { await Invoke(GetOperation(), args); } }