Implemented CanCan and basic functions