Very basic cancan functionality in javascript