Open mikeymicrophone opened 5 years ago
The employers should be rendered with a helper in the same way that commissions and other resources are being done. Then, those other helpers should be updated to use the new method that provides them with access-managed edit and delete links.
The cancancan config in models/ability.rb
should be updated so that non-admins can't destroy anything.
Agents should have access to any deals they assist on. They should be able to view almost everything else. They should be able to edit assists on their deals until they are submitted.
On the employers index, each employer is accompanied by links to edit or delete it. Refactor these so that they are generated by a single method that takes the employer as an argument.
The method should use
cancancan
to check whether thecurrent_avatar
has permission to edit the record before printing the edit link, and likewise for the delete link.The icons that are used for edit and delete should not be hardcoded, but should be refactored into helpers called
edit_icon
anddestroy_icon
.