Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#274 closed defect (invalid)

data model permissions are only being added to 'auth_permissions' if custom permissions are also defined

Reported by: oubiwann@… Owned by: adrian
Component: Tools Version:
Severity: normal Keywords: permissions, database, tables, data model
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

(The following is adapted from an email I posted to the user group mail list here: http://groups-beta.google.com/group/django-users/browse_frm/thread/73bfc859841b8db1 )

There is a discrepancy between the permissions and the data
inserted into the permissions table. It *seems* the only
way to get permissions to populate the table properly is to define your
own. As soon as you define a permission of your own, and then run the
command

  django-admin.py install <your app>

the auto-generated perms + your custom perm get added to the proper
table in the database.

For instance, in your Poll class, add the following line:

  permissions = (("dummy", "Dummy permission"),)

and then run

  django-admin.py install polls

After install runs, you should see the three automatic/intrinsic perms as well as
your custom dummy permission. If this procedure is not performed (i.e., no custom permission is defined in the data model, the auth_permissions table does not get populated with the app's automatic permissions.

Change History (1)

comment:1 Changed 10 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

Permissions are only created in the auth_permissions table if a given model has an admin parameter set.

Note: See TracTickets for help on using tickets.
Back to Top