Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

The documentation is difficult to follow #78

Open
weasteam opened this issue Oct 3, 2017 · 0 comments
Open

The documentation is difficult to follow #78

weasteam opened this issue Oct 3, 2017 · 0 comments

Comments

@weasteam
Copy link

weasteam commented Oct 3, 2017

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.

  1. Is it the package of the permission we just installed?
  2. 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant