Implemented permission for ajax requests