code: def grant_permission_for(brain_or_object, permission, roles, acquire=0):
      
      obj = api.get_object(brain_or_object)
      valid_roles = get_valid_roles_for(obj)
      to_grant = list(get_roles_for_permission(permission, obj))
  
      if isinstance(roles, basestring):
          roles = [roles]
  
      for role in roles:
          if role not in to_grant:
              if role not in valid_roles:
                  raise ValueError("The Role '{}' is invalid.".format(role))
              # Append the role
              to_grant.append(role)
  
      manage_permission_for(obj, permission, to_grant, acquire=acquire)
docs: Grant the permission for the object to the defined roles
  
      Code extracted from `IRoleManager.manage_permission`
  
      :param brain_or_object: Catalog brain or object
      :param permission: The permission to be granted
      :param roles: The roles the permission to be granted to
      :param acquire: Flag to acquire the permission