quiz policies

This commit is contained in:
Mark Moser
2016-09-20 17:19:11 -05:00
parent ead9564fe8
commit 13610edcd1
7 changed files with 117 additions and 5 deletions

View File

@@ -16,9 +16,23 @@ class User < ApplicationRecord
end
# TODO: move to mixin: UserRoles
# define remaining helpers
def admin?
role == 'admin'
'admin' == role
end
# TODO: move to mixin: UserRoles
def manager?
%w(admin manager).include? role
end
# TODO: move to mixin: UserRoles
def recruiter?
'recruiter' == role
end
# TODO: move to mixin: UserRoles
def reviewer?
'reviewer' == role
end
private