%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/postgres_privileges.pyo

�
���^c
@@stdZddlmZmZmZd�Zdddddddddd�	Zddddddddd�ZdS(u$
Management of PostgreSQL Privileges
===================================

The postgres_privileges module is used to manage Postgres privileges.
Privileges can be set as either absent or present.

Privileges can be set on the following database object types:

* database
* schema
* tablespace
* table
* sequence
* language
* group

Setting the grant option is supported as well.

.. versionadded:: 2016.3.0

.. code-block:: yaml

    baruwa:
      postgres_privileges.present:
        - object_name: awl
        - object_type: table
        - privileges:
          - SELECT
          - INSERT
          - DELETE
        - grant_option: False
        - prepend: public
        - maintenance_db: testdb

.. code-block:: yaml

    andrew:
      postgres_privileges.present:
        - object_name: admins
        - object_type: group
        - grant_option: False
        - maintenance_db: testdb

.. code-block:: yaml

    baruwa:
      postgres_privileges.absent:
        - object_name: awl
        - object_type: table
        - privileges:
          - SELECT
          - INSERT
          - DELETE
        - prepend: public
        - maintenance_db: testdb

.. code-block:: yaml

    andrew:
      postgres_privileges.absent:
        - object_name: admins
        - object_type: group
        - maintenance_db: testdb
i(tabsolute_importtunicode_literalstprint_functioncC@sdtkrtdfStS(u5
    Only load if the postgres module is present
    upostgres.privileges_grantuFUnable to load postgres module.  Make sure `postgres.bins_dir` is set.(t__salt__tFalsetTrue(((sC/usr/lib/python2.7/site-packages/salt/states/postgres_privileges.pyt__virtual__Fs
upubliccC@sHi|d6id6td6dd6}|r7dj|�nd}i	|d6|d6|d	6|d
6|d6|	d6|d
6|
d6|d6}
td||||
�sD|dkr�|n|}tdr�d|d<dj||�|d<|Std||||
�r!dj||�|d<d|d|<qDdj||�|d<t|d<n|S(u�
    Grant the requested privilege(s) on the specified object to a role

    name
        Name of the role to which privileges should be granted

    object_name
       Name of the object on which the grant is to be performed.
       'ALL' may be used for objects of type 'table' or 'sequence'.

    object_type
       The object type, which can be one of the following:

       - table
       - sequence
       - schema
       - tablespace
       - language
       - database
       - group
       - function

       View permissions should specify `object_type: table`.

    privileges
       List of privileges to grant, from the list below:

       - INSERT
       - CREATE
       - TRUNCATE
       - CONNECT
       - TRIGGER
       - SELECT
       - USAGE
       - TEMPORARY
       - UPDATE
       - EXECUTE
       - REFERENCES
       - DELETE
       - ALL

       :note: privileges should not be set when granting group membership

    grant_option
        If grant_option is set to True, the recipient of the privilege can
        in turn grant it to others

    prepend
        Table and Sequence object types live under a schema so this should be
        provided if the object is not under the default `public` schema

    maintenance_db
        The name of the database in which the language is to be installed

    user
        System user all operations should be performed on behalf of

    db_user
        database username if different from config or default

    db_password
        user password if any password for a specified user

    db_host
        Database host if different from config or default

    db_port
        Database port if different from config or default
    unameuchangesuresultu*The requested privilege(s) are already setucommentu,u
privilegesugrant_optionuprependumaintenance_dburunasuhostuuseruportupasswordupostgres.has_privilegesugrouputestu2The privilege(s): {0} are set to be granted to {1}upostgres.privileges_grantu.The privilege(s): {0} have been granted to {1}uPresentu(Failed to grant privilege(s): {0} to {1}N(RtjointNoneRt__opts__tformatR(tnametobject_nametobject_typet
privilegestgrant_optiontprependtmaintenance_dbtusertdb_passwordtdb_hosttdb_porttdb_usertrettkwargst_privs((sC/usr/lib/python2.7/site-packages/salt/states/postgres_privileges.pytpresentOsBQ




cC@sAi|d6id6td6dd6}|r7dj|�nd}i|d6|d6|d	6|d
6|d6|
d6|	d
6|d6}td||||�r=|dkr�|n|}
tdr�d|d<dj|
|�|d<|Std||||�rdj|
|�|d<d|d|<q=dj|
|�|d<t|d<n|S(u�
    Revoke the requested privilege(s) on the specificed object(s)

    name
        Name of the role whose privileges should be revoked

    object_name
       Name of the object on which the revoke is to be performed

    object_type
       The object type, which can be one of the following:

       - table
       - sequence
       - schema
       - tablespace
       - language
       - database
       - group
       - function

       View permissions should specify `object_type: table`.

    privileges
       Comma separated list of privileges to revoke, from the list below:

       - INSERT
       - CREATE
       - TRUNCATE
       - CONNECT
       - TRIGGER
       - SELECT
       - USAGE
       - TEMPORARY
       - UPDATE
       - EXECUTE
       - REFERENCES
       - DELETE
       - ALL

       :note: privileges should not be set when revoking group membership

    prepend
        Table and Sequence object types live under a schema so this should be
        provided if the object is not under the default `public` schema

    maintenance_db
        The name of the database in which the language is to be installed

    user
        System user all operations should be performed on behalf of

    db_user
        database username if different from config or default

    db_password
        user password if any password for a specified user

    db_host
        Database host if different from config or default

    db_port
        Database port if different from config or default
    unameuchangesuresultu;The requested privilege(s) are not set so cannot be revokeducommentu,u
privilegesuprependumaintenance_dburunasuhostuuseruportupasswordupostgres.has_privilegesugrouputestu4The privilege(s): {0} are set to be revoked from {1}upostgres.privileges_revokeu0The privilege(s): {0} have been revoked from {1}uAbsentu+Failed to revoke privilege(s): {0} from {1}N(RRRRR	R
R(RRR
RRRRRRRRRRR((sC/usr/lib/python2.7/site-packages/salt/states/postgres_privileges.pytabsent�s@K




N(	t__doc__t
__future__RRRRRRR(((sC/usr/lib/python2.7/site-packages/salt/states/postgres_privileges.pyt<module>Bs&	u

Zerion Mini Shell 1.0