def _save_activity_rights(committer_id, activity_rights, activity_type, commit_message, commit_cmds):
 activity_rights.validate()
 if (activity_type == feconf.ACTIVITY_TYPE_EXPLORATION):
  model_cls = exp_models.ExplorationRightsModel
 elif (activity_type == feconf.ACTIVITY_TYPE_COLLECTION):
  model_cls = collection_models.CollectionRightsModel
 model = model_cls.get(activity_rights.id, strict=False)
 model.owner_ids = activity_rights.owner_ids
 model.editor_ids = activity_rights.editor_ids
 model.viewer_ids = activity_rights.viewer_ids
 model.community_owned = activity_rights.community_owned
 model.status = activity_rights.status
 model.viewable_if_private = activity_rights.viewable_if_private
 model.first_published_msec = activity_rights.first_published_msec
 model.commit(committer_id, commit_message, commit_cmds)

def _save_activity_rights ( committer_id , activity_rights , activity_type , commit_message , commit_cmds ) : activity_rights . validate ( ) if ( activity_type == feconf . ACTIVITY_TYPE_EXPLORATION ) : model_cls = exp_models . ExplorationRightsModel elif ( activity_type == feconf . ACTIVITY_TYPE_COLLECTION ) : model_cls = collection_models . CollectionRightsModel model = model_cls . get ( activity_rights . id , strict = False ) model . owner_ids = activity_rights . owner_ids model . editor_ids = activity_rights . editor_ids model . viewer_ids = activity_rights . viewer_ids model . community_owned = activity_rights . community_owned model . status = activity_rights . status model . viewable_if_private = activity_rights . viewable_if_private model . first_published_msec = activity_rights . first_published_msec model . commit ( committer_id , commit_message , commit_cmds )
saves an explorationrights or collectionrights domain object to the datastore .