Esempio n. 1
0
def propose():
    if has('instance.admin') and c.instance.use_norms:
        return True
    if not c.instance.allow_propose:
        return False
    if c.instance.frozen:
        return False
    return has('page.edit')
Esempio n. 2
0
def propose():
    if has('instance.admin') and c.instance.use_norms:
        return True
    if not c.instance.allow_propose:
        return False
    if c.instance.frozen:
        return False
    return has('page.edit')
Esempio n. 3
0
def delete(co):
    if has('instance.admin'):
        return True
    if co.topic.instance.frozen:
        return False
    if edit(co) and is_own(co) and not co.is_edited():
        return True
    return has('comment.delete') and show(co) and not \
        (not co.topic.is_mutable() and co.canonical)
Esempio n. 4
0
def create(p):
    if not p.is_mutable():
        return False
    if has('instance.admin'):
        return True
    if not (has('proposal.edit') and show(p)):
        return False
    #if (p.description.head.wiki or is_own(p)):
    #    return True
    return True
Esempio n. 5
0
def create(p):
    if not p.is_mutable():
        return False
    if has('instance.admin'):
        return True
    if not (has('proposal.edit') and show(p)):
        return False
    #if (p.description.head.wiki or is_own(p)):
    #    return True
    return True
Esempio n. 6
0
def edit(co):
    if not co.is_mutable():
        return False
    if has('instance.admin'):
        return True
    if co.topic.instance.frozen:
        return False
    if not (has('comment.edit') and show(co)):
        return False
    if not (co.wiki or is_own(co)):
        return False
    return True
Esempio n. 7
0
def edit(check, p, variant):
    check.valid_email()
    check.other('instance_without_norms', not p.instance.use_norms)
    check.other('instance_frozen', p.instance.frozen)
    check.other('variant_is_none', variant is None)
    if has('instance.admin'):
        return
    page.edit(check, p)

    check.other('page_has_no_variants_and_variant_is_not_head',
                not p.has_variants and variant != Text.HEAD)

    if not has('page.edit_head'):
        check.other('page_function_is_norm_and_variant_is_head',
                    p.function == p.NORM and variant == Text.HEAD)
Esempio n. 8
0
def message(check, i):
    check.readonly()

    if has('global.message'):
        return
    check.other('is_not_authenticated', not i.is_authenticated)
    check.perm('instance.message')
Esempio n. 9
0
def message(check, i):
    check.readonly()

    if has('global.message'):
        return
    check.other('is_not_authenticated', not i.is_authenticated)
    check.perm('instance.message')
Esempio n. 10
0
def leave(i):
    if g.single_instance:
        return False
    if i.frozen:
        return False
    return show(i) and has('instance.leave') and c.user and \
        c.user.is_member(i) and not c.user == i.creator
Esempio n. 11
0
def create(check, p):
    check.valid_email()
    check.other('proposal_not_mutable', not p.is_mutable())
    if has('instance.admin'):
        return
    check.perm('proposal.edit')
    show(check, p)
Esempio n. 12
0
def leave(i):
    if g.single_instance:
        return False
    if i.frozen:
        return False
    return show(i) and has('instance.leave') and c.user and \
        c.user.is_member(i) and not c.user == i.creator
Esempio n. 13
0
def delete(check, t):
    if has('instance.admin'):
        return
    check.perm('tag.delete')
    show(check, t)
    check.other('not_logged_in', not c.user)
    check.other('tag_creator_is_not_user', t.creator != c.user)
Esempio n. 14
0
def delete(check, p, variant):
    check.valid_email()
    check.other('variant_is_none', variant is None)
    check.other('variant_is_head', variant == Text.HEAD)
    if has('instance.admin'):
        return
    page.delete(check, p)
Esempio n. 15
0
def propose(check):
    check.other('instance_without_norms', not c.instance.use_norms)
    if has('instance.admin'):
        return
    check.other('no_instance_allow_propose', not c.instance.allow_propose)
    check.other('instance_frozen', c.instance.frozen)
    check.perm('page.edit')
Esempio n. 16
0
File: page.py Progetto: whausen/part
def edit(check, p):
    check.valid_email()
    check.other('page_not_mutable', not p.is_mutable())
    if has('instance.admin'):
        return
    check.perm('page.edit')
    show(check, p)
Esempio n. 17
0
def edit(check, co):
    check.other('comment_not_mutable', not co.is_mutable())
    if has('instance.admin'):
        return
    check.other('comment_topic_instance_frozen', co.topic.instance.frozen)
    check.perm('comment.edit')
    show(check, co)
    check.other('comment_is_not_wiki_or_own', not (co.wiki or is_own(co)))
Esempio n. 18
0
File: tag.py Progetto: whausen/part
def delete(check, t):
    check.valid_email()
    if has('instance.admin'):
        return
    check.perm('tag.delete')
    show(check, t)
    check.other(NOT_LOGGED_IN, not c.user)
    check.other('tag_creator_is_not_user', t.creator != c.user)
Esempio n. 19
0
def create(check, p):
    check.readonly()
    check.valid_email()
    check.other('proposal_not_mutable', not p.is_mutable())
    if has('instance.admin'):
        return
    check.perm('proposal.edit')
    show(check, p)
Esempio n. 20
0
def delete(p, variant):
    if variant is None:
        return False
    if variant == Text.HEAD:
        return False
    if has("instance.admin"):
        return True
    return page.delete(p)
Esempio n. 21
0
def delete(p, variant):
    if variant is None:
        return False
    if variant == Text.HEAD:
        return False
    if has('instance.admin'):
        return True
    return page.delete(p)
Esempio n. 22
0
def edit(check, co):
    check.other('comment_not_mutable', not co.is_mutable())
    if has('instance.admin'):
        return
    check.other('comment_topic_instance_frozen', co.topic.instance.frozen)
    check.perm('comment.edit')
    show(check, co)
    check.other('comment_is_not_wiki_or_own', not (co.wiki or is_own(co)))
Esempio n. 23
0
def create_on(check, topic):
    check.readonly()
    check.valid_email()
    if has('instance.admin'):
        return
    check.other('comment_topic_frozen', topic.is_frozen())
    check.other('comment_topic_instance_frozen', topic.instance.frozen)
    create(check)
Esempio n. 24
0
File: tag.py Progetto: alkadis/vcv
def delete(check, t):
    check.readonly()
    check.valid_email()
    if has("instance.admin"):
        return
    check.perm("tag.delete")
    show(check, t)
    check.other(NOT_LOGGED_IN, not c.user)
    check.other("tag_creator_is_not_user", t.creator != c.user)
Esempio n. 25
0
def delete(check, co):
    if has('instance.admin'):
        return
    check.other('comment_topic_instance_frozen', co.topic.instance.frozen)
    edit(check, co)
    check.other('comment_is_not_own', not is_own(co))
    check.other('comment_is_edited', co.is_edited())
    check.perm('comment.delete')
    show(check, co)
    check.other('comment_not_mutable', not co.topic.is_mutable())
Esempio n. 26
0
def delete(check, co):
    if has('instance.admin'):
        return
    check.other('comment_topic_instance_frozen', co.topic.instance.frozen)
    edit(check, co)
    check.other('comment_is_not_own', not is_own(co))
    check.other('comment_is_edited', co.is_edited())
    check.perm('comment.delete')
    show(check, co)
    check.other('comment_not_mutable', not co.topic.is_mutable())
Esempio n. 27
0
def edit(p, variant):
    if not p.instance.use_norms:
        return False
    if p.instance.frozen:
        return False
    if variant is None:
        return False
    if has("instance.admin"):
        return True
    if not page.edit(p):
        return False
    if not p.has_variants and variant != Text.HEAD:
        return False
    if p.function == p.NORM and variant == Text.HEAD:
        return False
    return True
Esempio n. 28
0
def edit(p, variant):
    if not p.instance.use_norms:
        return False
    if p.instance.frozen:
        return False
    if variant is None:
        return False
    if has('instance.admin'):
        return True
    if not page.edit(p):
        return False
    if not p.has_variants and variant != Text.HEAD:
        return False
    if p.function == p.NORM and variant == Text.HEAD:
        return False
    return True
Esempio n. 29
0
def index():
    return has('tag.show')
Esempio n. 30
0
def create_on(check, topic):
    if has('instance.admin'):
        return
    check.other('topic_instance_frozen', topic.instance.frozen)
    create(check)
Esempio n. 31
0
def show(t):
    return has('tag.show')
Esempio n. 32
0
def show(c):
    return has('comment.view') and not c.is_deleted()
Esempio n. 33
0
def join(i):
    if i.frozen:
        return False
    return show(i) and has('instance.join') and c.user and \
        not c.user.is_member(i)
Esempio n. 34
0
def delete(i):
    if g.single_instance:
        return False
    return has('global.admin') and show(i)
Esempio n. 35
0
def edit(i):
    return has('instance.admin') and show(i)
Esempio n. 36
0
def create():
    if g.single_instance:
        return False
    return has('instance.create')
Esempio n. 37
0
def show(i):
    return has('instance.show') and not i.is_deleted()
Esempio n. 38
0
def any_admin(check):
    check.readonly()
    if has('global.admin'):
        return
    check.perm('instance.admin')
Esempio n. 39
0
def index():
    return has('comment.view')
Esempio n. 40
0
def delete(t):
    if has('instance.admin'):
        return True
    return has('tag.delete') and show(t) and c.user and t.creator == c.user
Esempio n. 41
0
def edit(t):
    return has('tag.edit') and show(t)
Esempio n. 42
0
def index():
    if g.single_instance:
        return False
    return has('instance.index')
Esempio n. 43
0
def any_admin(check):
    check.readonly()
    if has('global.admin'):
        return
    check.perm('instance.admin')
Esempio n. 44
0
def create(check, instance):

    if has('global.message'):
        return
    check.other('is_not_authenticated', not instance.is_authenticated)
    check.perm('instance.message')
Esempio n. 45
0
def create_on(topic):
    if has('instance.admin'):
        return True
    if topic.instance.frozen:
        return False
    return create()
Esempio n. 46
0
def create():
    return has('comment.create')