This repository was archived by the owner on Jul 21, 2021. It is now read-only.
This repository was archived by the owner on Jul 21, 2021. It is now read-only.
The documentation is difficult to follow #78
Open
Description
class Article(models.Model):
title = models.CharField('title', max_length=120)
body = models.TextField('body')
project = models.ForeignKey('permission.Project')
# this is just required for easy explanation
class Meta:
app_label='permission'
class Project(models.Model):
title = models.CharField('title', max_length=120)
body = models.TextField('body')
author = models.ForeignKey(User)
# this is just required for easy explanation
class Meta:
app_label='permission'
# apply AuthorPermissionLogic to Article
from permission import add_permission_logic
from permission.logics import AuthorPermissionLogic
add_permission_logic(Article, AuthorPermissionLogic(
field_name='project__author',
))
I am really not sure what is the permission
mentioned in the code block.
- Is it the package of the
permission
we just installed? - Is it an app that host the Article and Project?
It is really difficult to follow when applying to my own code on which permission
should I replace and which permission
should I keep.
Metadata
Metadata
Assignees
Labels
No labels