Class: Ability
- Inherits:
-
Object
- Object
- Ability
- Includes:
- CanCan::Ability
- Defined in:
- app/models/ability.rb
Instance Method Summary collapse
-
#initialize(member) ⇒ Ability
constructor
A new instance of Ability.
Constructor Details
#initialize(member) ⇒ Ability
Returns a new instance of Ability.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/models/ability.rb', line 4 def initialize(member) # alias_action :index, :show, :update, :to => :manage_users member ||= Member.new if member.has_role? :employee can :invite, User can :index, Cancellation can :index, Task can :show, Cancellation can :index, Job can :update, Cancellation can :cancel, Cancellation can :index, Candidate can :trade, Candidate can :deny, Candidate can :create, Feedback can :manage, Message can :manage, Mailboxer::Conversation can :index, ShiftOff can :create, Organization can :index, Organization can :save_employees, Organization can :login_organization, Organization can :select_org_member, Organization can :published_schedules, Schedule can :export, Schedule can :overview, Schedule can :email_export, Schedule can :export_pdf, Schedule can :editable_schedules, Schedule # need further consideration on shift can :manage, Shift can :index, ShiftTrade can :select, ShiftTrade can :index, Swap can :show, Swap can :update, Swap can :cancel, Swap can :index, Timeoff do |t| t.user_id == user.id end can :create, Timeoff can :show, Timeoff can :update, Timeoff can :cancel, Timeoff can :check_unique_date, Timeoff # user part can :profile, User do |u| u.id = user.id end can :update, User do |u| u.id = user.id end can :org_members, User do |u| u.id = user.id end else can :manage, :all end end |