Esempio n. 1
0
def can_change_permissions(article, user):
    if isinstance(settings.CAN_CHANGE_PERMISSIONS, collections.Callable):
        return settings.CAN_CHANGE_PERMISSIONS(article, user)
    return (
        not user.is_anonymous() and (
            article.owner == user or 
            user.has_perm('wiki.assign')
        )
    )
Esempio n. 2
0
def can_change_permissions(article, user):
    return not user.is_anonymous() and settings.CAN_CHANGE_PERMISSIONS(
        article, user)
def can_change_permissions(article, user):
    if callable(settings.CAN_CHANGE_PERMISSIONS):
        return settings.CAN_CHANGE_PERMISSIONS(article, user)
    return not user.is_anonymous and (article.owner == user
                                      or user.has_perm("wiki.assign"))