Django

Code

Ticket #2927 (closed: duplicate)

Opened 2 years ago

Last modified 10 months ago

[patch] In admin, user shouldn't see "add" buttons if they don't have the permission.

Reported by: SmileyChris Assigned to: nobody
Milestone: Component: Admin interface
Version: Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

There's the save and add another button, and the add button next to the foreign key widget. Neither should show if the user doesn't have the correct permissions.

Attachments

fix_admin_add_buttons.patch (3.8 kB) - added by SmileyChris on 10/17/06 23:04:15.
Here's the patch to make this all work.
fix_admin_add_buttons.2.patch (4.0 kB) - added by SmileyChris on 11/06/06 23:18:14.
less brittle patch as requested
fix_admin_add_buttons.3.patch (4.0 kB) - added by SmileyChris on 11/06/06 23:19:41.
Oops, the real less brittle patch this time.
fix_admin_add_buttons.4.patch (3.9 kB) - added by SmileyChris on 11/06/06 23:21:10.
Umm... third time's a charm... (turns out you have to save files before creating patch)

Change History

10/17/06 23:04:15 changed by SmileyChris

  • attachment fix_admin_add_buttons.patch added.

Here's the patch to make this all work.

10/17/06 23:04:46 changed by SmileyChris

  • summary changed from In admin, user shouldn't see "add" buttons if they don't have the permission. to [patch] In admin, user shouldn't see "add" buttons if they don't have the permission..

11/06/06 20:23:21 changed by jacob

I like the concept, but reading the context (in admin_modify) isn't OK; template tags should not assume anything about the context. Can you rework the patch to be less brittle?

11/06/06 23:18:14 changed by SmileyChris

  • attachment fix_admin_add_buttons.2.patch added.

less brittle patch as requested

11/06/06 23:19:41 changed by SmileyChris

  • attachment fix_admin_add_buttons.3.patch added.

Oops, the real less brittle patch this time.

11/06/06 23:21:10 changed by SmileyChris

  • attachment fix_admin_add_buttons.4.patch added.

Umm... third time's a charm... (turns out you have to save files before creating patch)

01/30/07 03:02:05 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

Does this need to be updated for newforms.admin?

09/16/07 13:39:49 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

The popup part of this is a duplicate of #1035, and the buttons part is a duplicate of #3817. In the spirit of "one issue per ticket", I'm closing this one in favor of the two separate tickets.


Add/Change #2927 ([patch] In admin, user shouldn't see "add" buttons if they don't have the permission.)




Change Properties
Action