add deleting, promoting/demoting, guesting (soft banning) users
This commit is contained in:
@ -27,7 +27,7 @@ end)
|
||||
|
||||
app:get("topic_create", "/create", function(self)
|
||||
local user = util.get_logged_in_user(self) or util.TransientUser
|
||||
if not user:is_admin() then
|
||||
if not user:is_mod() then
|
||||
return {status = 403}
|
||||
end
|
||||
|
||||
@ -36,7 +36,7 @@ end)
|
||||
|
||||
app:post("topic_create", "/create", function(self)
|
||||
local user = util.get_logged_in_user(self) or util.TransientUser
|
||||
if not user:is_admin() then
|
||||
if not user:is_mod() then
|
||||
return {redirect_to = "all_topics"}
|
||||
end
|
||||
|
||||
@ -72,7 +72,7 @@ app:get("topic", "/:slug", function(self)
|
||||
self.thread_create_error = ThreadCreateError.GUEST
|
||||
elseif user:is_guest() then
|
||||
self.thread_create_error = ThreadCreateError.LOGGED_OUT
|
||||
elseif util.ntob(topic.is_locked) and not user:is_admin() then
|
||||
elseif util.ntob(topic.is_locked) and not user:is_mod() then
|
||||
self.thread_create_error = ThreadCreateError.TOPIC_LOCKED
|
||||
end
|
||||
|
||||
@ -81,7 +81,7 @@ end)
|
||||
|
||||
app:get("topic_edit", "/:slug/edit", function(self)
|
||||
local user = util.get_logged_in_user_or_transient(self)
|
||||
if not user:is_admin() then
|
||||
if not user:is_mod() then
|
||||
return {redirect_to = self:url_for("topic", {slug = self.params.slug})}
|
||||
end
|
||||
local topic = Topics:find({
|
||||
@ -96,7 +96,7 @@ end)
|
||||
|
||||
app:post("topic_edit", "/:slug/edit", function(self)
|
||||
local user = util.get_logged_in_user_or_transient(self)
|
||||
if not user:is_admin() then
|
||||
if not user:is_mod() then
|
||||
return {redirect_to = self:url_for("topic", {slug = self.params.slug})}
|
||||
end
|
||||
local topic = Topics:find({
|
||||
|
Reference in New Issue
Block a user