backend-plus 1.19.2 → 1.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -481,6 +481,11 @@ AppBackend.prototype.isAdmin = function isAdmin(reqOrContext){
481
481
  return reqOrContext && (reqOrContext.forDump || reqOrContext.user && reqOrContext.user[be.config.login.rolFieldName] == 'admin');
482
482
  }
483
483
 
484
+ AppBackend.prototype.canChangePass = async function canChangePass(reqOrContext, _userToChangePass){
485
+ var be = this;
486
+ return be.isAdmin(reqOrContext);
487
+ }
488
+
484
489
  AppBackend.prototype._Browsers = {
485
490
  Edge: {short:'Ed' , minVer:14 , polly:true},
486
491
  Konqueror: {short:'Kq' , minVer:null, polly:true},
@@ -651,7 +651,7 @@ ProcedureTables = [
651
651
  {name:'newpass'},
652
652
  ],
653
653
  coreFunction:async function(context, parameters){
654
- if(context.be.isAdmin(context) && context.user[context.be.config.login.userFieldName]!=parameters.user){
654
+ if(await context.be.canChangePass(context, parameters.user) && context.user[context.be.config.login.userFieldName]!=parameters.user){
655
655
  var ok = await context.be.changePassword(context.client,parameters.user,false,parameters.newpass);
656
656
  if(ok){
657
657
  return ok
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for typed controls",
4
- "version": "1.19.2",
4
+ "version": "1.19.4",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",