Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An example project implementing object level permissions with fiber.
Python JavaScript Ruby
branch: master

This branch is 2 commits ahead of markotibold:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
fiber_permissions
fixtures
project
sass
.gitignore
README.rst
__init__.py
config.rb
config_clean_css.rb
custom_permissions.py
manage.py
requirements.txt
settings_default.py
settings_example.py
urls.py

README.rst

Fiber Permissions Example

This example project shows what could be a per-object permission implementation for Fiber.

Getting started

Install the requirements:

pip install -r requirements.txt

Load the fixtures:

python manage.py syncdb --migrate  # don't generate an admin user
python manage.py loaddata fixtures/example_initial_data.json
python manage.py loaddata fixtures/auth_and_guardian_data.json

The initial data comes with two users:

admin/admin
example-user/test

Login as example-user. You'll now have limited rights to edit / move / delete pages and content items.

Assigning permissions

You can assign object-level permissions to a user as follows:

from django.contrib.auth.models import User
u = User.objects.get(username='example-user')
from guardian.shortcuts import assign
from fiber.models import Page
p = Page.objects.get(title='A')
assign('change_page', u, p)

Via the admin give staff permission to 'example-user' and give him all permissions associated to Fiber.

Something went wrong with that request. Please try again.