huskar_api/models/auth/application.py
def ensure(cls, authority, user_id, application_id):
        """Creates an application auth if it does not exist.

        :param authority: ``AUTHORITY_READ`` or ``AUTHORITY_WRITE``
        :param user_id: The id of owner.
        :param application_id: The id of application.
        """
        assert authority in Authority

        stmt = cls.upsert().values(
            authority=authority.value, user_id=user_id,
            application_id=application_id)
        with DBSession().close_on_exit(False) as db:
            db.execute(stmt)
            cls.flush_by(authority, user_id, application_id)
Creates an application auth if it does not exist.

        :param authority: ``AUTHORITY_READ`` or ``AUTHORITY_WRITE``
        :param user_id: The id of owner.
        :param application_id: The id of application.
        
Creates an application auth if it does not exist.
Creates an application auth if it does not exist .
def ensure(cls, authority, user_id, application_id):
        assert authority in Authority
        stmt = cls.upsert().values(
            authority=authority.value, user_id=user_id,
            application_id=application_id)
        with DBSession().close_on_exit(False) as db:
            db.execute(stmt)
            cls.flush_by(authority, user_id, application_id)
def ensure ( cls , authority , user_id , application_id ) : assert authority in Authority stmt = cls . upsert ( ) . values ( authority = authority . value , user_id = user_id , application_id = application_id ) with DBSession ( ) . close_on_exit ( False ) as db : db . execute ( stmt ) cls . flush_by ( authority , user_id , application_id )
Creates an application auth if it does not exist.
Creates an application auth if it does not exist .
"""Creates an application auth if it does not exist.

        :param authority: ``AUTHORITY_READ`` or ``AUTHORITY_WRITE``
        :param user_id: The id of owner.
        :param application_id: The id of application.
        """
cls
authority
``AUTHORITY_READ`` or ``AUTHORITY_WRITE``
` ` AUTHORITY_READ ` ` or ` ` AUTHORITY_WRITE ` `
user_id
The id of owner.
The id of owner .
application_id
The id of application.
The id of application .