django.contrib.auth.models.Permission - python examples

Here are the examples of the python api django.contrib.auth.models.Permission taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 View Complete Implementation : acl.py
Copyright Apache License 2.0
Author : silverbackhq
    def new_permission(self, name, content_type_id, codename):
        permission = Permission()
        permission.name = name
        permission.content_type_id = content_type_id
        permission.codename = codename
        permission.save()

        return False if permission.pk is None else permission