diff --git a/spaceauth/caps.py b/spaceauth/caps.py index a82eb23..9545b9c 100644 --- a/spaceauth/caps.py +++ b/spaceauth/caps.py @@ -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)