sync/rank.js

32 lines
723 B
JavaScript
Raw Normal View History

2013-02-16 17:19:59 +00:00
/**
* Copyright 2013 Calvin 'calzoneman' Montgomery
*
* Licensed under Creative Commons Attribution-NonCommercial 3.0
* See http://creativecommons.org/licenses/by-nc/3.0/
*
*/
2013-02-16 05:02:42 +00:00
exports.Guest = 0;
exports.Member = 1;
exports.Moderator = 2;
exports.Owner = 3;
2013-02-16 05:02:42 +00:00
exports.Siteadmin = 255;
var permissions = {
2013-03-06 22:02:40 +00:00
acp: exports.Siteadmin,
2013-02-16 05:02:42 +00:00
queue: exports.Moderator,
assignLeader: exports.Moderator,
2013-03-05 20:23:02 +00:00
kick: exports.Moderator,
promote: exports.Moderator,
2013-02-16 05:02:42 +00:00
search: exports.Guest,
chat: exports.Guest,
};
// Check if someone has permission to do shit
exports.hasPermission = function(user, what) {
if(what in permissions) {
return user.rank >= permissions[what];
}
else return false;
}