Skip to content

Commit

Permalink
Removing trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
randalldegges-okta-2 committed Feb 21, 2011
1 parent 5ce50c0 commit 3f3f06d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
14 changes: 7 additions & 7 deletions docs/check_decorator.txt
Expand Up @@ -19,10 +19,10 @@ Lets start with an example permission::
class FlatpagePermission(permissions.BasePermission):
label = 'flatpage_permission'
checks = ('can_do_foo',)

def can_do_foo(self):
# ...

authority.register(Campaign, FlatpagePermission)

A decorator for such a simple view would look like::
Expand Down Expand Up @@ -53,12 +53,12 @@ a string on the decorator::
@permission_required('flatpage_permission.can_do_foo', 'arg1', 'arg2')
def my_view(required, arg1, arg2):
# ...

What happens under the hood?::

# Assumed the view gets called like this
my_view(request, 'bla', 'blubb')

# At the end, the decorator would been called like this
can_do_foo('bla', 'blubb')

Expand All @@ -78,9 +78,9 @@ Here is an example::
# permission.py
def can_do_foo(self, flatpage_instance=None):
# ...
# views.py
from django.contrib.flatpages.models import Flatpage

# views.py
from django.contrib.flatpages.models import Flatpage
@permission_required('flatpage_permission.can_do_foo', (Flatpage, 'url__iexact', 'url))
def flatpage(required, url):
# ...
Expand Down
2 changes: 1 addition & 1 deletion docs/check_python.txt
Expand Up @@ -4,4 +4,4 @@
Check permissions in python code
================================

*to be written*
*to be written*
4 changes: 2 additions & 2 deletions docs/check_templates.txt
Expand Up @@ -50,7 +50,7 @@ Syntax and example::

{% get_permissions obj as "my_permissions" %}
{% get_permissions obj for request.user as "my_permissions" %}


get_permission
==============
Expand All @@ -66,7 +66,7 @@ Example::

{% get_permission "poll_permission.change_poll" for request.user and poll as "is_allowed" %}
{% get_permission "poll_permission.change_poll" for request.user and poll,second_poll as "is_allowed" %}

{% if is_allowed %}
I've got ze power to change ze pollllllzzz. Muahahaa.
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.txt
@@ -1,5 +1,5 @@
.. _configuration:

=============
Configuration
=============
Expand Down Expand Up @@ -31,7 +31,7 @@ context processors::
'django.core.context_processors.media',
'django.core.context_processors.request',
)

urls.py
=======

Expand Down
8 changes: 4 additions & 4 deletions docs/create_basic_permission.txt
Expand Up @@ -70,7 +70,7 @@ In your python code
-------------------
::

def my_view(request):
def my_view(request):
check = FlatPagePermission(request.user)
if check.change_flatpage():
print "Yay, you can change a flatpage!"
Expand All @@ -84,9 +84,9 @@ Using the view decorator
@permission_required_or_403('flatpage_permission.change_flatpage')
def my_view(request):
# ...

See :ref:`check-decorator` how the decorator works in detail.

In your templates
-----------------
::
Expand All @@ -108,7 +108,7 @@ applications. See :ref:`configuration` how to set up ``autodiscover``.

.. image:: .static/authority-permission-py.png
:align: left

We encourage you to place your permission classes in a file called
``permissions.py`` inside your application directories. This will not only
keep your application files clean, but it will also load every permission
Expand Down
10 changes: 5 additions & 5 deletions docs/create_per_object_permission.txt
Expand Up @@ -9,7 +9,7 @@ permission*. A description would be::

Attach a <codename> to an object
Attach a <codename> to an user

If the user has <codename> and the object has <codename> then do-something,
otherwise do-something-else.

Expand Down Expand Up @@ -39,7 +39,7 @@ Create per-object permissions

Creating per-object permissions is super simple. See this piece of permission
class code::

class FlatPagePermission(BasePermission):
label = 'flatpage_permission'
checks = ('review',)
Expand Down Expand Up @@ -85,7 +85,7 @@ In your python code
::

from myapp.permissions import FlatPagePermission
def my_view(request):
def my_view(request):
check = FlatPagePermission(request.user)
flatpage_object = Flatpage.objects.get(url='/homepage/')
if check.review_flatpage(flatpage_object):
Expand All @@ -102,9 +102,9 @@ Using the view decorator
(Flatpage, 'url__iexact', 'url')) # The flatpage_object
def my_view(request, url):
# ...

See :ref:`check-decorator` how the decorator works in detail.

In your templates
-----------------
::
Expand Down
10 changes: 5 additions & 5 deletions docs/documentation_guidelines.txt
Expand Up @@ -13,13 +13,13 @@ Headline scheme
===================================
First level (equals top and bottom)
===================================

Second Level (equals bottom)
============================

Third level (dashes botton)
---------------------------

Fourth level (drunken dashes bottom)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -31,10 +31,10 @@ Overall salutation guidelines
Use the *We* and *you*::

We think that you should send us a bottle of your local beer.

Some thoughts
=============

* Many internal links are good
* Text should not be wider than 80 characters
* Two pages are better than one ultra-long page
* Two pages are better than one ultra-long page
2 changes: 1 addition & 1 deletion docs/handling_python.txt
Expand Up @@ -4,4 +4,4 @@
Handling permissions in python code
===================================

*to be written*
*to be written*
2 changes: 1 addition & 1 deletion docs/handling_template.txt
Expand Up @@ -4,4 +4,4 @@
Handling permissions using templates
====================================

*to be written*
*to be written*
14 changes: 7 additions & 7 deletions docs/index.txt
Expand Up @@ -37,15 +37,15 @@ Documentation

.. toctree::
:maxdepth: 1

installation
configuration

**Create and check permissions:**

.. toctree::
:maxdepth: 1

create_basic_permission
create_per_object_permission
create_custom_permission
Expand All @@ -54,7 +54,7 @@ Documentation

.. toctree::
:maxdepth: 2

check_python
check_decorator
check_templates
Expand All @@ -63,21 +63,21 @@ Documentation

.. toctree::
:maxdepth: 1

handling_python
handling_admin
handling_template

Other pages
===========

* :ref:`search`
* :ref:`genindex`

.. toctree::
:maxdepth: 1
:glob:

tips_tricks
support
documentation_guidelines
4 changes: 2 additions & 2 deletions docs/installation.txt
Expand Up @@ -15,9 +15,9 @@ The latest, stable version is always available via the `Python package index_`
would prefer either ``pip`` or ``easy_install``::

pip install django-authority

# .. or with easy_install:

easy_install django-authority

.. _the site: http://pypi.python.org/pypi/django-authority/
Expand Down

0 comments on commit 3f3f06d

Please sign in to comment.