mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
priv (unstable)
This commit is contained in:
1 parent
554698189c
commit
e092efca20
63 files changed
+706
-397
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user