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 }}
Repository navigation
Users lack permission to create API tokens for themselves #13299
I'm unable to create an API token as a non-superuser.
I followed the code flow and ended up doing
inventree=> select * from auth_permission where id=280;
id | name | content_type_id | codename
-----+--------------------+-----------------+---------------
280 | Can view API Token | 70 | view_apitoken
inventree => insert into auth_user_user_permissions values(default,3,280);
INSERT 0 1
Afterwards, I was able to create and revoke API tokens for my user.
I've tested this on both 1.7.2 and current master (1f51dfe) and the behavior is the same.
Another thing I noticed: Revoking a token is done using the DELETE verb. It works despite the permission check for it returning false and thus DELETE not being part of actions. Seems inconsistent to me.
Activity
sur5r commentedon Nov 16, 2026
Workaround using
manage.py shell:sur5r commentedon Nov 16, 2026
Another thing I noticed: Revoking a token is done using the
DELETEverb. It works despite the permission check for it returning false and thus DELETE not being part ofactions. Seems inconsistent to me.SchrodingersGat commentedon Nov 17, 2026
@sur5r thanks for reporting - fix is incoming in #13307
sur5r commentedon Nov 17, 2026
Thank you very much. I still don't understand why it worked on the demo site, though.
[bug] Fix for token issuance via UI (inventree#13307)
[bug] Fix for token issuance via UI (#13307) (#13313)