如何设置在Django中创建的默认权限名称? [英] how to set the default permission name created in Django?

查看:135
本文介绍了如何设置在Django中创建的默认权限名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用django 1.6

I'm using django 1.6

现在,当我定义一个模型时,它将为它创建三个权限记录( can_create can_update can_delete )。

Now when I define a model, it will create three permissions record for it (can_create, can_update, can_delete).

我现在在模型上添加其他权限(在这个问题上没有关系),并希望让用户将它们全部分配给用户和组。

I'm now adding other permissions on the models (which doesn't matter in this question), and want to make a view to let the user assign them all to users and groups.

现在问题是:

我想替换显示的默认名称

有没有办法这样做?

推荐答案

根据这个博文和这个 Django ticket ,I会说这是不可能的,也不建议改变这些代码es(因为它们在管理中使用)。但是,可以更改人类可读的名称(例如可以添加权限)

Based on this blog post and this Django ticket, I would say it is not possible and also not advisable to change these codenames (since they are used in the admin). It is however possible to change the human readable name (such as 'Can add permission')

这篇关于如何设置在Django中创建的默认权限名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆