Models

BaseObjectPermission

class guardian.models.BaseObjectPermission(*args, **kwargs)

Abstract ObjectPermission class. Actual class should additionally define a content_object field and either user or group field.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

UserObjectPermission

class guardian.models.UserObjectPermission(id, permission, content_type, object_pk, user)
exception DoesNotExist
exception MultipleObjectsReturned

GroupObjectPermission

class guardian.models.GroupObjectPermission(id, permission, content_type, object_pk, group)
exception DoesNotExist
exception MultipleObjectsReturned