backend-plus 1.19.2 → 1.19.3
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.
- package/lib/backend-plus.js +5 -0
- package/lib/procedures-table.js +1 -1
- package/package.json +1 -1
package/lib/backend-plus.js
CHANGED
|
@@ -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 isAdmin(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},
|
package/lib/procedures-table.js
CHANGED
|
@@ -651,7 +651,7 @@ ProcedureTables = [
|
|
|
651
651
|
{name:'newpass'},
|
|
652
652
|
],
|
|
653
653
|
coreFunction:async function(context, parameters){
|
|
654
|
-
if(context.be.
|
|
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