const { roleOf, canUseAssistant } = require("./assistant_permissions");

function canUse(user, config) {
  return canUseAssistant({
    user,
    config,
    origin: "webui",
    platform: "webui",
    requestedSurface: "webui_chat"
  }).allowed;
}
function roleAllows(actual, required) {
  const rank={anonymous:0,user:1,mod:2,admin:3}; return rank[actual] >= rank[required || "user"];
}
module.exports = { roleOf, canUse, roleAllows };
