WIP: cancan permissions; it breaks stuff!

This commit is contained in:
John N. Milner
2013-04-07 20:44:53 -04:00
parent ff708d940b
commit 6a29eda8d9
5 changed files with 24 additions and 19 deletions
+4 -8
View File
@@ -24,16 +24,12 @@ class User < ActiveRecord::Base
"#{first_name} #{last_name}"
end
def user?
user_role.to_s == "user"
def role
user_role.role
end
def staff?
user_role.to_s == "staff"
end
def admin?
user_role.to_s == "admin"
def role?(role)
user_role.to_s == role.to_s
end
def total_hours