Add the moderator role

This commit is contained in:
Las Zenow 2016-10-16 20:05:45 -04:00
parent baf2b5a6a9
commit dcc2d3b9dc
9 changed files with 28 additions and 16 deletions

View file

@ -16,7 +16,7 @@ const (
)
func deleteHandler(h handler) {
if !h.sess.IsAdmin() {
if !h.sess.IsModerator() {
notFound(h)
return
}
@ -54,7 +54,7 @@ func deleteHandler(h handler) {
func editHandler(h handler) {
id := mux.Vars(h.r)["id"]
if !h.sess.IsAdmin() {
if !h.sess.IsModerator() {
notFound(h)
return
}
@ -83,7 +83,7 @@ func cleanEmptyStr(s []string) []string {
func saveHandler(h handler) {
id := mux.Vars(h.r)["id"]
if !h.sess.IsAdmin() {
if !h.sess.IsModerator() {
notFound(h)
return
}
@ -133,7 +133,7 @@ type newData struct {
}
func newHandler(h handler) {
if !h.sess.IsAdmin() {
if !h.sess.IsModerator() {
notFound(h)
return
}
@ -177,7 +177,7 @@ func newHandler(h handler) {
}
func storeHandler(h handler) {
if !h.sess.IsAdmin() {
if !h.sess.IsModerator() {
notFound(h)
return
}