Skip to content

UniversalMLPredictionObject Tagging

PeilanWang edited this page May 4, 2021 · 1 revision

Prediction Object Tagging

File Name Description
Tag update model/tag/update
Roles that able to tag model/tag/role/update

Tag Update

Summary: Allows authorized users to add or remove tags from the UniversalMLPredictionObject.

Parameters:

  • md5_hashes: List of unique md5_hashes signed to the object
  • remove_tags: List of tags that needs to be removed from the object tag list
  • new_tags: List of tags that needs to be added to the object tag list
  • Username: username of the user (can remove)

Return: A list of status for each md5_hashes entered.

Tag Role Update

Summary: Only authorized user types are allowed to make changes to the tags, this function gives or removes certain roles' power to edit the tags for certain UniversalMLPredictionObject. (Currently, all roles (admin, investigator, research) can access this endpoint). Admin always allows access when the object is initially created.

Parameters:

  • md5_hashes: List of unique md5_hashes signed to the object
  • new_roles: List of user roles that can access tag/update for that object
  • remove_roles: List of user roles that no longer can access tag/update for that Object

Return: List of status for each of the md5_hashes passed in.

Change the access ability of Tag Role Update:

# at dbconnection.py function: update_role_to_tag_object
if set(user.roles) & {"admin", "investigator", "researcher"}:

Change the set {"admin", "investigator", "researcher"} in order to change who can access model/tag/role/update endpoint