Beispiel #1
0
def profiles_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if isinstance(app, basestring) and app != "profiles":
        return True

    perms = {"create_user": ["Admin", "Mentor"], "can_edit_profiles": ["Admin"], "can_delete_profiles": ["Admin"]}

    add_permissions_to_groups("profiles", perms)
Beispiel #2
0
def featuredrep_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'featuredrep'):
        return True

    perms = {'can_edit_featured': ['Admin'], 'can_delete_featured': ['Admin']}

    add_permissions_to_groups('featuredrep', perms)
Beispiel #3
0
def featuredrep_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'featuredrep'):
        return True

    perms = {'can_edit_featured': ['Admin', 'Council'],
             'can_delete_featured': ['Admin', 'Council']}

    add_permissions_to_groups('featuredrep', perms)
Beispiel #4
0
def featuredrep_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if isinstance(app_label, basestring) and app_label != "featuredrep":
        return True

    perms = {"can_edit_featured": ["Admin", "Council"], "can_delete_featured": ["Admin", "Council"]}

    add_permissions_to_groups("featuredrep", perms)
Beispiel #5
0
def voting_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'voting'):
        return True

    permissions = {'add_poll': ['Admin', 'Council', 'Mentor'],
                   'delete_poll': ['Admin', 'Council', 'Mentor'],
                   'change_poll': ['Admin', 'Council', 'Mentor']}

    add_permissions_to_groups('voting', permissions)
Beispiel #6
0
def profiles_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'profiles'):
        return True

    perms = {'create_user': ['Admin', 'Mentor'],
             'can_edit_profiles': ['Admin'],
             'can_delete_profiles': ['Admin']}

    add_permissions_to_groups('profiles', perms)
Beispiel #7
0
def featuredrep_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'featuredrep'):
        return True

    perms = {'can_edit_featured': ['Admin', 'Council'],
             'can_delete_featured': ['Admin', 'Council']}

    add_permissions_to_groups('featuredrep', perms)
Beispiel #8
0
def report_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'reports'):
        return True

    perms = {'can_edit_reports': ['Admin', 'Mentor'],
             'can_delete_reports': ['Admin', 'Mentor'],
             'can_delete_report_comments': ['Admin', 'Mentor']}

    add_permissions_to_groups('reports', perms)
Beispiel #9
0
def featuredrep_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'featuredrep'):
        return True

    perms = {'can_edit_featured': ['Admin', 'Council', 'Peers'],
             'can_delete_featured': ['Admin', 'Council', 'Peers']}

    add_permissions_to_groups('featuredrep', perms)
Beispiel #10
0
def event_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'events'):
        return True

    perms = {'can_edit_events': ['Admin', 'Council', 'Mentor', 'Rep'],
             'can_delete_events': ['Admin', 'Council', 'Mentor'],
             'can_subscribe_to_events': ['Admin', 'Council', 'Mentor', 'Rep']}

    add_permissions_to_groups('events', perms)
Beispiel #11
0
def voting_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'voting'):
        return True

    permissions = (('voting.add_poll', ['Admin']),
                   ('voting.delete_poll', ['Admin']),
                   ('voting.change_poll', ['Admin']))

    add_permissions_to_groups('voting', permissions)
Beispiel #12
0
def profiles_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'profiles'):
        return True

    perms = {'create_user': ['Admin', 'Mentor'],
             'can_edit_profiles': ['Admin'],
             'can_delete_profiles': ['Admin']}

    add_permissions_to_groups('profiles', perms)
Beispiel #13
0
def voting_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'voting'):
        return True

    permissions = (('voting.add_poll', ['Admin']),
                   ('voting.delete_poll', ['Admin']), ('voting.change_poll',
                                                       ['Admin']))

    add_permissions_to_groups('voting', permissions)
Beispiel #14
0
def event_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'events'):
        return True

    perms = {
        'can_edit_events': ['Admin', 'Council', 'Mentor', 'Rep'],
        'can_delete_events': ['Admin', 'Council', 'Mentor'],
        'can_subscribe_to_events': ['Admin', 'Council', 'Mentor', 'Rep']
    }

    add_permissions_to_groups('events', perms)
Beispiel #15
0
def voting_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'voting'):
        return True

    permissions = {'add_poll': ['Admin', 'Council', 'Mentor', 'Review'],
                   'delete_poll': ['Admin', 'Council', 'Mentor', 'Review'],
                   'change_poll': ['Admin', 'Council', 'Mentor', 'Review'],
                   'delete_pollcomment': ['Admin']}

    add_permissions_to_groups('voting', permissions)
Beispiel #16
0
def profiles_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'profiles'):
        return True

    perms = {'create_user': ['Admin', 'Council', 'Mentor'],
             'can_edit_profiles': ['Admin', 'Council'],
             'can_delete_profiles': ['Admin'],
             'can_change_mentor': ['Admin', 'Council']}

    add_permissions_to_groups('profiles', perms)
Beispiel #17
0
def report_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'reports'):
        return True

    perms = {
        'can_edit_reports': ['Admin', 'Mentor'],
        'can_delete_reports': ['Admin', 'Mentor'],
        'can_delete_report_comments': ['Admin', 'Mentor']
    }

    add_permissions_to_groups('reports', perms)
Beispiel #18
0
def report_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if isinstance(app, basestring) and app != "reports":
        return True

    perms = {
        "can_edit_reports": ["Admin", "Mentor"],
        "can_delete_reports": ["Admin", "Mentor"],
        "can_delete_report_comments": ["Admin", "Mentor"],
    }

    add_permissions_to_groups("reports", perms)
Beispiel #19
0
def voting_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if (isinstance(app, basestring) and app != 'voting'):
        return True

    permissions = {
        'add_poll': ['Admin', 'Council', 'Mentor'],
        'delete_poll': ['Admin', 'Council', 'Mentor'],
        'change_poll': ['Admin', 'Council', 'Mentor']
    }

    add_permissions_to_groups('voting', permissions)
Beispiel #20
0
def event_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'events'):
        return True

    perms = {'can_edit_events': ['Admin', 'Council', 'Mentor', 'Rep'],
             'can_delete_events': ['Admin', 'Council', 'Mentor'],
             'can_delete_event_comments': ['Admin'],
             'can_subscribe_to_events': ['Admin', 'Council', 'Mentor', 'Rep',
                                         'Alumni', 'Mozillians']}

    add_permissions_to_groups('events', perms)
Beispiel #21
0
def event_set_groups(app, sender, signal, **kwargs):
    """Set permissions to groups."""
    if isinstance(app, basestring) and app != "events":
        return True

    perms = {
        "can_edit_events": ["Admin", "Council", "Mentor", "Rep"],
        "can_delete_events": ["Admin", "Council", "Mentor"],
        "can_delete_event_comments": ["Admin"],
        "can_subscribe_to_events": ["Admin", "Council", "Mentor", "Rep", "Mozillians"],
    }

    add_permissions_to_groups("events", perms)
Beispiel #22
0
def report_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'reports'):
        return True

    perms = {
        'add_ngreport': ['Admin', 'Mentor'],
        'change_ngreport': ['Admin', 'Mentor'],
        'delete_ngreport': ['Admin', 'Mentor'],
        'delete_ngreportcomment': ['Admin', 'Mentor']
    }

    add_permissions_to_groups('reports', perms)
Beispiel #23
0
def profiles_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'profiles'):
        return True

    perms = {
        'create_user': ['Admin', 'Council', 'Mentor'],
        'can_edit_profiles': ['Admin', 'Council'],
        'can_delete_profiles': ['Admin'],
        'can_change_mentor': ['Admin', 'Council']
    }

    add_permissions_to_groups('profiles', perms)
Beispiel #24
0
def voting_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'voting'):
        return True

    permissions = {
        'add_poll': ['Admin', 'Council', 'Mentor', 'Review'],
        'delete_poll': ['Admin', 'Council', 'Mentor', 'Review'],
        'change_poll': ['Admin', 'Council', 'Mentor', 'Review'],
        'delete_pollcomment': ['Admin']
    }

    add_permissions_to_groups('voting', permissions)
Beispiel #25
0
def report_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if isinstance(app_label, basestring) and app_label != "reports":
        return True

    perms = {
        "add_ngreport": ["Admin", "Mentor"],
        "change_ngreport": ["Admin", "Mentor"],
        "delete_ngreport": ["Admin", "Mentor"],
        "delete_ngreportcomment": ["Admin", "Mentor"],
    }

    add_permissions_to_groups("reports", perms)
Beispiel #26
0
def event_set_groups(sender, **kwargs):
    """Set permissions to groups."""
    app_label = sender.label
    if (isinstance(app_label, basestring) and app_label != 'events'):
        return True

    perms = {
        'can_edit_events': ['Admin', 'Council', 'Mentor', 'Rep'],
        'can_delete_events': ['Admin', 'Council', 'Mentor'],
        'can_delete_event_comments': ['Admin'],
        'can_subscribe_to_events':
        ['Admin', 'Council', 'Mentor', 'Rep', 'Alumni', 'Mozillians']
    }

    add_permissions_to_groups('events', perms)