示例#1
0
def is_saksbehandler_for_tilskuddsordning(tilskuddsordning, user):
    return (is_saksbehandler(user)
            and user.get('id') in [s.saksbehandler_id for s in tilskuddsordning.saksbehandlere])
示例#2
0
def they_can_post_tilskuddsordning_action(user, they):
    if is_saksbehandler(user):
        they.can(POST, 'TilskuddsordningAction')
示例#3
0
def they_can_post_saksvedlegg(user, they):
    if is_saksbehandler(user):
        they.can(POST, 'Saksvedlegg')
示例#4
0
def is_saksbehandler_for_soknad(soknad, user):
    if soknad.saksbehandler_id:
        return (is_saksbehandler(user)
                and soknad.saksbehandler_id == user.get('id')
                and is_saksbehandler_for_tilskuddsordning(soknad.tilskuddsordning, user))
示例#5
0
def they_can_get_standardtekster(user, they):
    if is_saksbehandler(user) or is_administrator(user):
        they.can(GET, 'StandardTekst')
示例#6
0
def they_can_get_saksvedlegg(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'Saksvedlegg')
示例#7
0
def they_can_get_tilskuddsordninger(user, they):
    if is_administrator(user) or is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'Tilskuddsordning')
    elif is_soker(user):
        they.can(GET, 'Tilskuddsordning', if_tilskuddsordning_is_published)
示例#8
0
def they_can_get_rapport(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'Rapport', partial(if_soknad_is_not_in_status_rapport_pabegynt))
    else:
        they.can(GET, 'Rapport', partial(if_rapport_owner, user=user))
示例#9
0
def they_can_get_soknader(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'Soknad', partial(if_soknad_is_not_kladd))
    elif is_soker(user):
        they.can(GET, 'Soknad', partial(if_soker_can_manage_soknad, user=user))
示例#10
0
def they_can_get_generated_vedtaksbrev(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'GeneratedVedtaksbrev')
示例#11
0
def they_can_get_erv_file(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'ErvFile')