Exemple #1
0
def policy_edit(request,table):

	if "HTTP_REFERER" in request.META:
		# Checks if the referer page is the home or this page itself
		if "/dashboard" in request.META['HTTP_REFERER'] or "/policies" in request.META['HTTP_REFERER']:
			ruleTableSet = RuleTableManager.getAllInstances(RuleTableManager.getDefaultName())
			return simple.direct_to_template(request,
                                          template = 'policyEngine/policy_edit.html',
                                          extra_context = {'user': request.user,
                                                           'CurrentTable': ruleTableSet}
                                        )
	# If the access flow is incorrect, send home
	return HttpResponseRedirect("/")
Exemple #2
0
def policy_edit(request, table):

    if "HTTP_REFERER" in request.META:
        # Checks if the referer page is the home or this page itself
        if "/dashboard" in request.META[
                'HTTP_REFERER'] or "/policies" in request.META['HTTP_REFERER']:
            ruleTableSet = RuleTableManager.getAllInstances(
                RuleTableManager.getDefaultName())
            return simple.direct_to_template(
                request,
                template='policyEngine/policy_edit.html',
                extra_context={
                    'user': request.user,
                    'CurrentTable': ruleTableSet
                })
    # If the access flow is incorrect, send home
    return HttpResponseRedirect("/")