st2common/st2common/rbac/utils.py
def assert_user_has_resource_api_permission(user_db, resource_api, permission_type):
    """
    Check that currently logged-in user has specified permission for the resource which is to be
    created.
    """
    has_permission = user_has_resource_api_permission(user_db=user_db,
                                                      resource_api=resource_api,
                                                      permission_type=permission_type)

    if not has_permission:
        # TODO: Refactor exception
        raise ResourceAccessDeniedError(user_db=user_db, resource_db=resource_api,
                                        permission_type=permission_type)

    Check that currently logged-in user has specified permission for the resource which is to be
    created.
    
Check that currently logged-in user has specified permission for the resource which is to be
created.
Check that currently logged - in user has specified permission for the resource which is to be created .
def assert_user_has_resource_api_permission(user_db, resource_api, permission_type):
    has_permission = user_has_resource_api_permission(user_db=user_db,
                                                      resource_api=resource_api,
                                                      permission_type=permission_type)
    if not has_permission:
        raise ResourceAccessDeniedError(user_db=user_db, resource_db=resource_api,
                                        permission_type=permission_type)
def assert_user_has_resource_api_permission ( user_db , resource_api , permission_type ) : has_permission = user_has_resource_api_permission ( user_db = user_db , resource_api = resource_api , permission_type = permission_type ) if not has_permission : raise ResourceAccessDeniedError ( user_db = user_db , resource_db = resource_api , permission_type = permission_type )
Check that currently logged-in user has specified permission for the resource which is to be
created.
Check that currently logged - in user has specified permission for the resource which is to be created .
"""
    Check that currently logged-in user has specified permission for the resource which is to be
    created.
    """ # TODO: Refactor exception
user_db
resource_api
permission_type