Exemple #1
0
 def _decorated_view (request, pw_pk=None, **kwargs):
     if not pw_pk or check_authorization(pw_pk, request.user.username):
         return view_func(request, pw_pk, **kwargs)
     elif check_authorization(pw_pk, request.user.username) == None:
         return view_func(request, None, **kwargs) 
     else:
         raise PermissionDenied(str(get_ldap_groups(request.user.username))+request.user.username)
Exemple #2
0
 def _decorated_view(request, pw_pk=None, **kwargs):
     if not pw_pk or check_authorization(pw_pk, request.user.username):
         return view_func(request, pw_pk, **kwargs)
     elif check_authorization(pw_pk, request.user.username) == None:
         return view_func(request, None, **kwargs)
     else:
         raise PermissionDenied(
             str(get_ldap_groups(request.user.username)) +
             request.user.username)
Exemple #3
0
def index(request):
    username = request.user.username
    user_passwords = filter(lambda p: check_authorization(p.pk, username),
        Password.objects.all())
    
    if request.session.get('showOnly', True):
        show_only_accessible = True
    else:
        show_only_accessible = False

    baseUrl = '/'
    
    return direct_to_template(request, 'passwords/index.html', {'passwords': Password.objects.all(), 'user_passwords': user_passwords, 'showOnly': show_only_accessible, 'baseUrl': baseUrl})
Exemple #4
0
def index(request):
    username = request.user.username
    user_passwords = filter(lambda p: check_authorization(p.pk, username),
                            Password.objects.all())

    if request.session.get('showOnly', True):
        show_only_accessible = True
    else:
        show_only_accessible = False

    baseUrl = '/'

    return direct_to_template(
        request, 'passwords/index.html', {
            'passwords': Password.objects.all(),
            'user_passwords': user_passwords,
            'showOnly': show_only_accessible,
            'baseUrl': baseUrl
        })