priv (unstable)

This commit is contained in:
undefined committed 2020-06-29 13:33:44 +08:00
1 parent 554698189c
commit e092efca20
63 files changed
+706 -397

No files matched your search

+12
View File
@@ -112,6 +112,17 @@ class PermissionError extends ForbiddenError {
}
}
class PrivilegeError extends ForbiddenError {
constructor(priv) {
if (priv === global.Hydro.model.builtin.PRIV.PRIV_USER_PROFILE) {
super("You're not logged in.");
} else {
super("You don't have the required privilege.");
}
this.params = [priv];
}
}
class ValidationError extends ForbiddenError {
constructor(field0, field1) {
super('ValidationError');
@@ -245,6 +256,7 @@ global.Hydro.error = module.exports = {
ProblemDataNotFoundError,
OpcountExceededError,
PermissionError,
PrivilegeError,
NoProblemError,
ValidationError,
ProblemNotFoundError,