caps: Fix cap_check when unauthenticated
parent
4dd1c63912
commit
80c74deded
|
@ -7,7 +7,9 @@ import time
|
|||
|
||||
|
||||
def cap_check(capability, user=None):
|
||||
if not current_user.is_authenticated:
|
||||
'''Checks if specified user (or current user) has desired capacifier
|
||||
capability'''
|
||||
if not user and not current_user.is_authenticated:
|
||||
return False
|
||||
|
||||
user = user or current_user.get_id()
|
||||
|
@ -38,7 +40,8 @@ def caps_cleanup(app, user):
|
|||
|
||||
|
||||
def cap_required(capability):
|
||||
'''Checks if user has desired capacifier capability'''
|
||||
'''Decorator to check if user has desired capacifier capability, returns
|
||||
403 otherwise'''
|
||||
|
||||
def inner(func):
|
||||
@functools.wraps(func)
|
||||
|
|
Loading…
Reference in New Issue