rename models and associates, isolate botanic with shop

This commit is contained in:
Ludovic CANDELLIER
2020-04-21 00:09:32 +02:00
parent c80b0f1edf
commit 4ad1f18310
234 changed files with 13899 additions and 3230 deletions

29
build/js/include/user.js Normal file
View File

@@ -0,0 +1,29 @@
function getCurrentUser() {
var user = $('#current_user').html();
return (typeof(user) != 'undefined') ? user : false;
}
function isConnected() {
return getCurrentUser() ? true : false;
}
function hasRole(str) {
return checkRole('admin') ? true : checkRole(str);
}
function checkRole(str) {
return (global.roles.indexOf(str) == -1 ) ? false : true;
}
function isAdmin() {
return hasRole('admin');
}
function hasPermission(str) {
if (isAdmin()) {
return true;
} else {
return (global.permissions.indexOf(str) == -1 ) ? false : true;
}
}