code: def CheckIfUserIsAdmin(self, username):
      
  
      user_obj = data_store.REL_DB.ReadGRRUser(username)
      if user_obj.user_type != user_obj.UserType.USER_TYPE_ADMIN:
        raise access_control.UnauthorizedAccess("User %s is not an admin." %
                                                username)
docs: Checks whether the user is an admin.