CyTube/rank.js

38 lines
1 KiB
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-20 18:35:06 +00:00
acp : exports.Siteadmin,
announce : exports.Siteadmin,
registerChannel : exports.Owner,
queue : exports.Moderator,
assignLeader : exports.Moderator,
kick : exports.Moderator,
promote : exports.Moderator,
qlock : exports.Moderator,
poll : exports.Moderator,
shout : exports.Moderator,
channelOpts : exports.Moderator,
2013-03-20 18:35:06 +00:00
search : exports.Guest,
chat : exports.Guest,
2013-02-16 05:02:42 +00:00
};
// 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;
}