diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-08-09 15:35:03 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-08-11 20:03:02 +0200 |
commit | 264545996c27fea790b4a7ebf27122ec0748a630 (patch) | |
tree | 50e112e271f9d77748f86e08474c42998e8c030b /app | |
parent | Recognize users that register using OpenID from dev.gentoo.org as mentors (diff) | |
download | recruiting-webapp-264545996c27fea790b4a7ebf27122ec0748a630.tar.gz recruiting-webapp-264545996c27fea790b4a7ebf27122ec0748a630.tar.bz2 recruiting-webapp-264545996c27fea790b4a7ebf27122ec0748a630.zip |
Don't show input for mentors to users who can't edit it
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 7ff0640..cb6afbe 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -105,7 +105,11 @@ class User < ActiveRecord::Base end def mentor_edit_permitted? - mentor.nil? || mentor_is?(acting_user) + return true if mentor_is?(acting_user) + return true if mentor.nil? && acting_user.role.is_mentor? + return true if mentor.nil? && acting_user.role.is_recruiter? + return true if acting_user.administrator? + false end def destroy_permitted? |