An example project implementing object level permissions with fiber.
Python JavaScript Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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 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 with as example-user. You'll now have limtited right 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.