
    ,                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr  SSK
Jr  SS	KJr  S
SSS.r\R                   " \R"                  R$                  5      \R&                   " S S\R(                  5      5       5       r\R                   " \R"                  R,                  5      \R&                   " S S\R(                  5      5       5       rg)/Test IAM permissions for a Design Center space.    )absolute_import)division)unicode_literals)spaces)utils)arg_parsers)base)flagsap           Tests the IAM permissions that a caller has on a Design Center space.

        Returns an empty set of permissions if the space does not exist.

        Note: This operation is designed to be used for building
        permission-aware UIs and command-line tools, not for authorization
        checking. This operation may "fail open" without warning.
        ar           To test if the caller has the `designcenter.spaces.get` and
        `designcenter.spaces.update` permissions on the Space `my-space` in
        project `my-project` and location `us-central1`, run:

          $ {command} my-space --location=us-central1 --project=my-project               --permissions=designcenter.spaces.get,designcenter.spaces.update
        z         This command uses the designcenter/v1alpha API. The full documentation for
        this API can be found at:
        http://cloud.google.com/application-design-center/docs
        )DESCRIPTIONEXAMPLESzAPI REFERENCEc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)TestIamPermissionsGA6   r   c                 |    [         R                  " U 5        U R                  SS[        R                  " 5       SSS9  g Nz--permissions
PERMISSIONTz1The set of permissions to check for the resource.)metavartyperequiredhelpr   AddTestIamPermissionsFlagsadd_argumentr	   ArgListparsers    8lib/surface/design_center/spaces/test_iam_permissions.pyArgsTestIamPermissionsGA.Args<   ;    	$$V,
  "@      c                     [         R                  " [        R                  R                  S9n[
        R                  " U5      nUR                  UR                  5       UR                  S9$ N)release_track)space_idpermissions)
apisSpacesClientr
   ReleaseTrackGAapi_lib_utilsGetSpaceRefTestIamPermissionsRelativeNamer'   selfargsclient	space_refs       r   RunTestIamPermissionsGA.RunG   s[    T->->-A-ABF))$/I$$'')$$ %  r"    N__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r5   __static_attributes__r7   r"   r   r   r   6   #     8 - r"   r   c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)r.   P   r   c                 |    [         R                  " U 5        U R                  SS[        R                  " 5       SSS9  g r   r   r   s    r   r   TestIamPermissions.ArgsV   r!   r"   c                     [         R                  " [        R                  R                  S9n[
        R                  " U5      nUR                  UR                  5       UR                  S9$ r$   )
r(   r)   r
   r*   ALPHAr,   r-   r.   r/   r'   r0   s       r   r5   TestIamPermissions.Runa   s[    T->->-D-DEF))$/I$$'')$$ %  r"   r7   Nr8   r7   r"   r   r.   r.   P   rB   r"   r.   N)r=   
__future__r   r   r   $googlecloudsdk.api_lib.design_centerr   r(   r   r,   googlecloudsdk.callioper	   r
   (googlecloudsdk.command_lib.design_centerr   r>   ReleaseTracksr*   r+   UniverseCompatibleCommandr   rH   r.   r7   r"   r   <module>rQ      s    6 &  ' ? G / ( :%4 D%%(()4<<   *0 D%%++,   -r"   