You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
I am really not sure what is the
permission
mentioned in the code block.permission
we just installed?It is really difficult to follow when applying to my own code on which
permission
should I replace and whichpermission
should I keep.The text was updated successfully, but these errors were encountered: