i using rails 4 make web app. i trying use cancancan define abilities various roles. i have user model , profile model. each user can have many profiles. each profile can have different role. in profile.rb, have defined roles (using role model gem) as: include rolemodel roles :admin, :manager, # coalfacer :student, :educator, :researcher, :ktp, :faculty_manager, :ip_asset_manager, # universities :sponsor, # industry :project_manager, :representative, # both uni , industry :grantor, :investor, :adviser, :innovation_consultant, :panel_member, # external :participant, :guest # public roles_attribute :roles_mask in ability.rb, trying define first ability, as: user ||= user.new # guest user (not logged in) #users not signed in can read publicly available projects can :read, project, {:active => true, :closed => false, && project.sweep.disclosure.allusers: true} in projects table, have boolean a...
Comments
Post a Comment