Example #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])
Example #2
0
def they_can_post_tilskuddsordning_action(user, they):
    if is_saksbehandler(user):
        they.can(POST, 'TilskuddsordningAction')
Example #3
0
def they_can_post_saksvedlegg(user, they):
    if is_saksbehandler(user):
        they.can(POST, 'Saksvedlegg')
Example #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))
Example #5
0
def they_can_get_standardtekster(user, they):
    if is_saksbehandler(user) or is_administrator(user):
        they.can(GET, 'StandardTekst')
Example #6
0
def they_can_get_saksvedlegg(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'Saksvedlegg')
Example #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)
Example #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))
Example #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))
Example #10
0
def they_can_get_generated_vedtaksbrev(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'GeneratedVedtaksbrev')
Example #11
0
def they_can_get_erv_file(user, they):
    if is_saksbehandler(user) or is_godkjenner(user):
        they.can(GET, 'ErvFile')