I am getting
syntax error, unexpected keyword_end, expecting end-of-input
for line
if current_user.can_read @folder || current_user.can_write @folder
I was able to get it to work by changing it to
if current_user.can_read(@folder) || current_user.can_write(@folder)