1. Kai Diefenbach
  2. django-permissions-1.0

Commits

Kai Diefenbach  committed e36a0b3

Updated docs

  • Participants
  • Parent commits c155c43
  • Branches default

Comments (0)

Files changed (2)

File docs/usage/additional_groups.rst

View file
 
 .. code-block:: python
 
-from permissions.utils import register_permission
-permission = register_permission("View", "view")
-permission = register_permission("Edit", "edit")
+    from permissions.utils import register_permission
+    permission = register_permission("View", "view")
+    permission = register_permission("Edit", "edit")
 
-Create new groups
-------------------
+Create new role
+---------------
 
 .. code-block:: python
 
-from permissions.utils import register_role
-anonymous = register_role("Anonymous")
-owner = register_role("Owner")
+    from permissions.utils import register_role
+    anonymous = register_role("Anonymous")
+    owner = register_role("Owner")
 
 This will create default Django groups.
 
 
 .. code-block:: python
 
-from django.contrib.flatpages.models import FlatPage
-content = FlatPage.objects.create(title="Example", url="example")
+    from django.contrib.flatpages.models import FlatPage
+    content = FlatPage.objects.create(title="Example", url="example")
 
 Grant permissions
 -----------------
 
 .. code-block:: python
 
-from permissions.utils import grant_permission
-grant_permission(content, anonymous, "view")
-grant_permission(content, owner, "edit")
+    from permissions.utils import grant_permission
+    grant_permission(content, anonymous, "view")
+    grant_permission(content, owner, "edit")
 
 Now all users which are member of the special group "Anonymous" have the
 permission to view the object "content". And all users which are member of the
 
     if result == False:
         print "Alert!"
+
+More information
+----------------
+
+.. seealso::
+
+    This is just a simple use case. Look into the :doc:`API documentation <../api>` for more.

File docs/usage/simple.rst

View file
 
 .. warning::
 
-    django-permissions is in alpha state. Please consider the API as supposed 
+    django-permissions is in alpha state. Please consider the API as supposed
     to be changed until it reaches beta state.
 
 Create a new permission
     from permissions.utils import register_permission
     permission = register_permission("View", "view")
 
-Create a new group
-------------------
+Create a new role
+-----------------
 
 .. code-block:: python
 
     from permissions.utils import register_role
     editor = register_role("Editor")
-    
+
 Create a content object
 -----------------------
 
     from permissions.utils import grant_permission
     grant_permission(content, editor, "view")
 
-Now all users which are member of the group "Brights" have the permission to
-view object "content". 
-
-.. note::
-
-    You can also grant permission to single users.
+Now all users which are member of the role "Editor" have the permission to
+view object "content".
 
 Check permission
 ----------------
     if result == False:
         print "Alert!"
 
-This will check whether the current user has the permission "View" for the 
-FlatPage "content".
+This will check whether the current user has the permission "View" for the
+FlatPage "content".
+
+More information
+----------------
+
+.. seealso::
+
+    This is just a simple use case. Look into the :doc:`API documentation <../api>` for more.