Finishing touches on abilities and registration form

This commit is contained in:
2013-01-25 13:47:44 -07:00
parent 2327340b71
commit 3d00bbed03
9 changed files with 89 additions and 46 deletions

View File

@@ -16,12 +16,12 @@ class Ability
# Instructors can manage certs and see users
if user.instructor?
can :manage, Certification
can :read, User
can [:create,:read], User
can :manage, UserCertification
end
# Users can see others' stuff if they've been oriented
unless user.orientation.blank?
can :read, User
can :read, User, :hidden => [nil,false]
can :read, UserCertification
end
end

View File

@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :member, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level, :certifications
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :member, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level, :certifications, :hidden
has_many :cards
has_many :user_certifications