#NEWLINE# def check_policy_permissions( request , upload_policy ) : #NEWLINE# #INDENT# "\n    Check permissions on the given upload policy. Raises\n    rest_framework.exceptions.PermissionDenied in case\n    of error.\n\n    The acl must be 'private'. Uploading public files\n    using this API is a bad idea. By its nature, the\n    API will allow any user to upload any file. If\n    files are public that likely means you're exposing\n    the keys publicly, which means the files are\n    easily replaced by a user of this very API.\n\n    " #NEWLINE# from rest_framework.exceptions import PermissionDenied #NEWLINE# if ( upload_policy [ 'acl' ] . value != 'private' ) : #NEWLINE# #INDENT# raise PermissionDenied ( _ ( "ACL should be 'private'" ) ) #NEWLINE# #UNINDENT# check_upload_permissions ( request = upload_policy , bucket = upload_policy [ 'bucket' ] . value , key = upload_policy [ 'key' ] . value )