# Path: cms/permissions.py
# def is_user_slc_leader(user):
# def can_user_create_project(user):
# def can_user_edit_project(user, project):
# def can_user_delete_project(user, project):
# def can_user_demote_project_coordinators(user, project):
# def can_user_create_member(user):
# def can_user_edit_member(user, member):
# def can_user_delete_member(user, member):
# def can_user_archive_member(user, member):
# def can_user_reactivate_member(user, member):
# def can_user_post_as_member(user, member):
# def can_user_edit_blogpost(user, blogpost):
# def can_user_create_page(user):
# def can_user_edit_page(user, page):
# def can_user_delete_page(user, page):
# def can_user_delete_sponsor(user):
# def can_user_create_sponsor(user):


import re
import calendar
from django import template
from django.conf import settings
from django.contrib.auth.models import User
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
from cms import permissions



register = template.Library()

@register.filter
@stringfilter
def stripjs(value):
    stripped = re.compile(r'<script(?:\s[^>]*)?(>(?:.(?!/script>))*</script>|/>)', re.S).sub('', force_unicode(value))
    return mark_safe(stripped)

@register.filter
def logged_in(user):
    if user is None or user.id is None:
        return False

    return user.id != -1

@register.filter
def is_slc_leader(user):

# Path: cms/permissions.py
# def is_user_slc_leader(user):
# def can_user_create_project(user):
# def can_user_edit_project(user, project):
# def can_user_delete_project(user, project):
# def can_user_demote_project_coordinators(user, project):
# def can_user_create_member(user):
# def can_user_edit_member(user, member):
# def can_user_delete_member(user, member):
# def can_user_archive_member(user, member):
# def can_user_reactivate_member(user, member):
# def can_user_post_as_member(user, member):
# def can_user_edit_blogpost(user, blogpost):
# def can_user_create_page(user):
# def can_user_edit_page(user, page):
# def can_user_delete_page(user, page):
# def can_user_delete_sponsor(user):
# def can_user_create_sponsor(user):


# Path: cms/templatetags/filters.py
import re
import calendar
from django import template
from django.conf import settings
from django.contrib.auth.models import User
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
from cms import permissions




register = template.Library()

@register.filter
@stringfilter
def stripjs(value):
    stripped = re.compile(r'<script(?:\s[^>]*)?(>(?:.(?!/script>))*</script>|/>)', re.S).sub('', force_unicode(value))
    return mark_safe(stripped)

@register.filter
def logged_in(user):
    if user is None or user.id is None:
        return False

    return user.id != -1

@register.filter
def is_slc_leader(user):

    return permissions.is_user_slc_leader(user)