Sunday, 15 September 2013

employee abilities with CanCan

employee abilities with CanCan

I have a Ticket model, Employee model and User model.
Each Employee may have a ticket assigned for him by the admin or more than
one ticket.
When employee is created in employee model it will be created also in user
model using a callback. and employee.id not the same as employee.user_id.
ticket model has employee_id attribute which is refering to for whom this
ticket is assigned
I need to make each employee see the assigned tickets for him. but the
problem is cancan is initialized for user and ticket doesn't have user_id
, also employee.id not the same as employee.user_id , how can i make this
work ? any suggestions because i have searched for this but all i find is
about user.

No comments:

Post a Comment