aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2014-04-21 01:40:59 -0400
committerTeddy Wing2014-04-21 01:40:59 -0400
commit9c403d3f37caf0931fc9d6751f4992b454454db2 (patch)
tree22ce4ed39ecc05bf245ec4e993898bcf2b52cdd7
parent2a3d8fcd286d58c51e35331aea859492d3737142 (diff)
downloaddjango-sneak-peek-9c403d3f37caf0931fc9d6751f4992b454454db2.tar.bz2
README: update to include User Permissions section
Add a section that describes how to give users permission to view content designated as 'sneak peek'.
-rw-r--r--README.rdoc15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.rdoc b/README.rdoc
index 4050873..4e54f3f 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -55,6 +55,21 @@ Wrap secret markup in <code>sneak_peek</code> tags:
{% endsneak_peek %}
+== User Permissions
+In order to determine whether to output the markup, <code>django-sneak-peek</code> relies on the <code>sneak_peek_tag.can_view_sneak_peek</code> permission which is installed via the included migration.
+
+To allow a user to view sneak peek content, add this permission to their account. This can be done in the Django admin or via the shell:
+
+ >>> from django.contrib.contenttypes.models import ContentType
+ >>> from django.contrib.auth.models import Permission
+ >>>
+ >>> content_type = ContentType.objects.get(app_label='sneak_peek_tag')
+ >>> permission = Permission.objects.get(content_type=content_type, codename='can_view_sneak_peek')
+ >>>
+ >>> user = User.objects.get(username='Homer')
+ >>> user.user_permissions.add(permission)
+
+
== Additional Options
By default, markup under sneak peek will appear with a yellow and black "under construction" border: