WiP on permissions

Doesn't run. This commit is just to backup the changes.
This commit is contained in:
Tomas Bures 2017-07-26 22:42:05 +03:00
parent 5df444f641
commit 89c9615592
37 changed files with 913 additions and 366 deletions

View file

@ -68,6 +68,12 @@ class DependencyNotFoundError extends InteroperableError {
}
}
class PermissionDeniedError extends InteroperableError {
constructor(msg, data) {
super('PermissionDeniedError', msg, data);
}
}
const errorTypes = {
InteroperableError,
NotLoggedInError,
@ -79,7 +85,8 @@ const errorTypes = {
DuplicitEmailError,
IncorrectPasswordError,
InvalidTokenError,
DependencyNotFoundError
DependencyNotFoundError,
PermissionDeniedError
};
function deserialize(errorObj) {

View file

@ -1,9 +0,0 @@
'use strict';
function usernameValid(username) {
return /^[a-zA-Z0-9][a-zA-Z0-9_\-.]*$/.test(username);
}
module.exports = {
usernameValid
};