Models — django-guardian v0.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- django-guardian v0.1.1 documentation »
- API Reference »

# Models

Return to API Reference.

## BaseObjectPermission

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

  Abstract ObjectPermission class.

  `content_object`

    Provides a generic relation to any object through content-type/object-id fields.

## UserObjectPermission

class `guardian.models.` `UserObjectPermission`(*args, **kwargs)

  UserObjectPermission(id, permission_id, content_type_id, object_id, user_id)

  `content_object`

    Provides a generic relation to any object through content-type/object-id fields.

class `guardian.managers.` `UserObjectPermissionManager`
  `assign`(perm, user, obj)

    Assigns permission with given `perm` for an instance `obj` and `user`.

  `remove_perm`(perm, user, obj)

    Removes permission `perm` for an instance `obj` and given `user`.

## GroupObjectPermission

class `guardian.models.` `GroupObjectPermission`(*args, **kwargs)

  GroupObjectPermission(id, permission_id, content_type_id, object_id, group_id)

  `content_object`

    Provides a generic relation to any object through content-type/object-id fields.

class `guardian.managers.` `GroupObjectPermissionManager`
  `assign`(perm, group, obj)

    Assigns permission with given `perm` for an instance `obj` and `group`.

  `remove_perm`(perm, group, obj)

    Removes permission `perm` for an instance `obj` and given `group`.

### Navigation

- index
- modules |
- next |
- previous |
- django-guardian v0.1.1 documentation »
- API Reference »