@stephskardal helped us clean up the CanCan Ability file.
There were some pieces that were super hard to read, notably in the teacher section.
|
cannot :manage, Document do |tors| |
|
if tors.user.nil? # This has been driving me insane. |
|
false |
|
else |
|
tors.user.id == user.id |
|
end |
|
end |
For now, we removed the ugly unreadable code. However, we should probably find out from the upstream project what the intended permissions for teachers is supposed to be.
@stephskardal helped us clean up the CanCan Ability file.
There were some pieces that were super hard to read, notably in the teacher section.
Annotation-Studio/app/models/ability.rb
Lines 16 to 22 in 65e959c
For now, we removed the ugly unreadable code. However, we should probably find out from the upstream project what the intended permissions for teachers is supposed to be.