+
+ def owner_uuid
+ self.user.andand.uuid
+ end
+ def owner_uuid_was
+ self.user_id_changed? ? User.find(self.user_id_was).andand.uuid : self.user.andand.uuid
+ end
+ def owner_uuid_changed?
+ self.user_id_changed?
+ end
+
+ def uuid
+ self.api_token
+ end
+ def uuid=(x) end
+ def uuid_was
+ self.api_token_was
+ end
+ def uuid_changed?
+ self.api_token_changed?
+ end
+
+ def modified_by_client_uuid
+ nil
+ end
+ def modified_by_client_uuid=(x) end
+
+ def modified_by_user_uuid
+ nil
+ end
+ def modified_by_user_uuid=(x) end
+
+ def modified_at
+ nil
+ end
+ def modified_at=(x) end
+
+ protected
+
+ def permission_to_create
+ current_user.andand.is_admin or (current_user.andand.id == self.user_id)
+ end
+
+ def permission_to_update
+ (permission_to_create and
+ not self.user_id_changed? and
+ not self.owner_uuid_changed?)
+ end