mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 15:26:46 -06:00
Adding validation for the previleges control.
This commit is contained in:
parent
dc51baefcc
commit
a02b1a4813
@ -177,6 +177,22 @@
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
var err = {},
|
||||
errmsg = null,
|
||||
changedAttrs = this.sessAttrs,
|
||||
msg = undefined;
|
||||
// We will throw error if user have not entered
|
||||
// either grantee or privileges
|
||||
if (_.has(changedAttrs, 'grantor')) {
|
||||
if (_.isUndefined(this.get('grantee')) ||
|
||||
this.get('privileges').length == 0) {
|
||||
errmsg = 'Please specify grantee/privileges';
|
||||
this.errorModel.set('grantee', errmsg);
|
||||
return errmsg;
|
||||
}
|
||||
} else {
|
||||
this.errorModel.unset('grantee');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user