//[HasPermission(typeof(CanReadVoucherRequirement))] TODO User management Permissions
        public async Task <ActionResult <User> > PatchLocked([FromRoute] int id, [FromBody] bool locked)
        {
            var request = new UsersLockRequest()
            {
                Id = id, Locked = locked
            };

            return(await this._userService.UpdateLocked(request).Convert <User>(this));
        }
Exemple #2
0
        public async Task <IWrappedResponse> UpdateLocked(UsersLockRequest request)
        {
            var cmd = ServiceCommand <User, Rules.User.UpdateLock.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.User.UpdateLock.MainRule(request))
                      .Then(UpdateLockedAction);

            return(await cmd.Execute());
        }
 public MainRule(UsersLockRequest request, IRule parentRule = null)
 {
     // Create Context
     Context    = new ContextModel(request, this);
     ParentRule = parentRule;
 }