Opened 4 years ago

Last modified 4 years ago

#31256 closed Uncategorized

Inline widget permision is now based on it's foregin key. — at Version 3

Reported by: John Lyu Owned by: nobody
Component: contrib.admin Version: 2.1
Severity: Normal Keywords: Inlines, permision
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by John Lyu)

Use an old example:

in models.py

class Ticket(models.Model):
........

class Action(models.Model):

    ticket = models.ForeignKey(Ticket)
........

in admin.py:

class ActionInline(admin.TabularInline):
    model = Action
    extra=1
    max_num=3

class TicketAdmin(admin.ModelAdmin):

.........
        inlines = [
        ActionInline,
        ]

In version 2.1.15:

If I set current user's permisson edit_Action but no edit Ticket, I will not be able to edit actions inlines in "Change Ticket" page.

Based on https://docs.djangoproject.com/en/3.0/releases/2.1.15/, that bug fix is rude and confusing.

In fact, I can still change Action it self and indirectly "change" the page of it's parent Ticket. We should stop trigger save method in this condition instead of disable the feature.

Change History (3)

comment:1 by John Lyu, 4 years ago

Description: modified (diff)
Version: 3.02.2

comment:2 by John Lyu, 4 years ago

Description: modified (diff)

comment:3 by John Lyu, 4 years ago

Description: modified (diff)
Version: 2.22.1
Note: See TracTickets for help on using tickets.
Back to Top