def allow_add_attachment_by(user):
 if (user.is_superuser or user.is_staff):
  return True
 if user.has_perm('attachments.add_attachment'):
  return True
 if user.has_perm('attachments.disallow_add_attachment'):
  return False
 return True

def allow_add_attachment_by ( user ) : if ( user . is_superuser or user . is_staff ) : return True if user . has_perm ( 'attachments.add_attachment' ) : return True if user . has_perm ( 'attachments.disallow_add_attachment' ) : return False return True
returns whether the user is allowed to upload attachments .