@assignment_tag(takes_context=True)
def page_permissions(context, page):
 if (u'user_page_permissions' not in context):
  context[u'user_page_permissions'] = UserPagePermissionsProxy(context[u'request'].user)
 return context[u'user_page_permissions'].for_page(page)

@ assignment_tag ( takes_context = True ) def page_permissions ( context , page ) : if ( u'user_page_permissions' not in context ) : context [ u'user_page_permissions' ] = UserPagePermissionsProxy ( context [ u'request' ] . user ) return context [ u'user_page_permissions' ] . for_page ( page )
usage: {% page_permissions page as page_perms %} sets the variable page_perms to a pagepermissiontester object that can be queried to find out what actions the current logged-in user can perform on the given page .