st2common/st2common/rbac/utils.py
def assert_user_has_resource_db_permission(user_db, resource_db, permission_type):
    """
    Check that currently logged-in user has specified permission on the provied resource.

    If user doesn't have a required permission, AccessDeniedError is thrown.
    """
    has_permission = user_has_resource_db_permission(user_db=user_db,
                                                     resource_db=resource_db,
                                                     permission_type=permission_type)

    if not has_permission:
        raise ResourceAccessDeniedError(user_db=user_db, resource_db=resource_db,
                                        permission_type=permission_type)

    Check that currently logged-in user has specified permission on the provied resource.

    If user doesn't have a required permission, AccessDeniedError is thrown.
    
Check that currently logged-in user has specified permission on the provied resource.
If user doesn't have a required permission, AccessDeniedError is thrown.
Check that currently logged - in user has specified permission on the provied resource . If user doesn ' t have a required permission AccessDeniedError is thrown .
def assert_user_has_resource_db_permission(user_db, resource_db, permission_type):
    has_permission = user_has_resource_db_permission(user_db=user_db,
                                                     resource_db=resource_db,
                                                     permission_type=permission_type)
    if not has_permission:
        raise ResourceAccessDeniedError(user_db=user_db, resource_db=resource_db,
                                        permission_type=permission_type)
def assert_user_has_resource_db_permission ( user_db , resource_db , permission_type ) : has_permission = user_has_resource_db_permission ( user_db = user_db , resource_db = resource_db , permission_type = permission_type ) if not has_permission : raise ResourceAccessDeniedError ( user_db = user_db , resource_db = resource_db , permission_type = permission_type )
Check that currently logged-in user has specified permission on the provied resource.
Check that currently logged - in user has specified permission on the provied resource .
"""
    Check that currently logged-in user has specified permission on the provied resource.

    If user doesn't have a required permission, AccessDeniedError is thrown.
    """
user_db
resource_db
permission_type