Package expedient :: Package common :: Package permissions :: Module managers :: Class PermissionOwnershipManager
[hide private]
[frames] | no frames]

Class PermissionOwnershipManager

source code


Manager for PermissionOwnership model.

Adds the delete_ownership and get_ownership methods to the default manager.

Instance Methods [hide private]
 
get_ownership(self, permission, obj_or_class, owner)
Get a PermissionOwnership instance.
source code
 
delete_ownership(self, permission, obj_or_class, owner)
Take permission away from an owner.
source code
 
delete_all_for_target(self, obj_or_class, owner)
Delete all the permissions owned by owner for target obj_or_class
source code

Inherited from django.db.models.manager.Manager: __init__, aggregate, all, annotate, complex_filter, contribute_to_class, count, create, dates, db_manager, defer, distinct, exclude, exists, extra, filter, get, get_empty_query_set, get_or_create, get_query_set, in_bulk, iterator, latest, none, only, order_by, raw, reverse, select_related, update, using, values, values_list

Inherited from django.db.models.manager.Manager (private): _copy_to_model, _insert, _set_creation_counter, _update

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from django.db.models.manager.Manager: creation_counter

Properties [hide private]

Inherited from django.db.models.manager.Manager: db

Inherited from object: __class__

Method Details [hide private]

get_ownership(self, permission, obj_or_class, owner)

source code 

Get a PermissionOwnership instance.

Parameters:
  • permission (str or ExpedientPermission.) - The name of the permission or its ExpedientPermission instance.
  • obj_or_class (Model instance or class.) - The target object or class for the permission.
  • owner (Permittee or Model instance.) - The permittee currently owning the permission.

delete_ownership(self, permission, obj_or_class, owner)

source code 

Take permission away from an owner.

Remove the permission permission to use object or class obj_or_class from the owner owner. If the owner doesn't have the permission to begin with, nothing happens.

Parameters:
  • permission (str or ExpedientPermission.) - The name of the permission to remove or its ExpedientPermission instance.
  • obj_or_class (Model instance or class.) - The object or class for which the permission is being removed
  • owner (Permittee or Model instance.) - The permittee currently owning the permission.

delete_all_for_target(self, obj_or_class, owner)

source code 

Delete all the permissions owned by owner for target obj_or_class

Parameters:
  • obj_or_class (Model instance or class.) - The object or class for which the permissions are being removed
  • owner (Permittee or Model instance.) - The permittee currently owning the permissions.