Defined developer/trainingmod rank

Defined the developer and trainingmod ranks to make it easier for others
to understand, and to make it easier to give them permissions in the
future (if needed).
This commit is contained in:
Jonas Folvik
2015-12-28 21:05:41 +01:00
parent e1fe02eacc
commit d5edeca666
2 changed files with 10 additions and 0 deletions

View File

@@ -61,6 +61,14 @@ class User < ActiveRecord::Base
!!(self.role >= :normal)
end
def trainingmod?
!!(self.role >= :trainingmod)
end
def developer?
!!(self.role >= :developer)
end
def mod?
!!(self.role >= :mod)
end

View File

@@ -5,6 +5,8 @@ Role.create!([
{name: "disabled", value: 1, color: "#ccc"},
{name: "banned", value: 2, color: "#ccc"},
{name: "normal", value: 10, color: "#282"},
{name: "trainingmod", value: 40, color: "#fa5"},
{name: "developer", value: 70, color: "#a0a"},
{name: "mod", value: 100, color: "#6af"},
{name: "admin", value: 200, color: "#d22"},
{name: "superadmin", value: 500, color: "#d22"}