Files
peeringdb-peeringdb/docs/dev/modules/org_admin_views.py.md
T
Stefan Pratter 5eb925e319 Support 202301 (#1329)
* fix next redirect when using U2F 2FA auth (#1191)

* Added self identifier to API

* fix migrations hierarchy after merging in previous support branch

* campus object

Co-authored-by: Stefan Pratter <stefan@20c.com>

* fix out of bound error message
add city / country to campus view

* fix tests

* relock poetry

* linting

* linting

* fix docs regen

* regen docs

* linting

* refactor self entity view to support carrier and campus object types and also make it easier to support additional object types in the future

* remove debug message

---------

Co-authored-by: Gajanan Patil <dipaksavaliya.python@gmail.com>
2023-02-15 07:55:01 +00:00

1.6 KiB

Generated from org_admin_views.py on 2023-02-14 15:33:37.135106

peeringdb_server.org_admin_views

View for organization administrative actions (/org endpoint).

Functions


extract_permission_id

def extract_permission_id(source, dest, entity, org)

Extract a user's permissioning id for the specified entity from source and store it in dest .

Source should be a dict containing django-namespace-perms (namespace, level) items.

Dest should be a dict where permission ids are to be exracted to.

Entity can either be a HandleRef instance or class.

Org must be an Organization instance that owns the entity.


load_all_user_permissions

def load_all_user_permissions(org)

Return dict of all users with all their permissions for the given org.


load_entity_permissions

def load_entity_permissions(org, entity)

Return entity's permissions for the specified org.


org_admin_required

def org_admin_required(fnc)

Decorator function that ensures that the requesting user has administrative rights to the targeted organization.

Also sets "org" in kwargs.


permission_ids

def permission_ids(org)

Return a dict of a valid permissioning ids for the specified organization.


save_user_permissions

def save_user_permissions(org, user, perms)

Save user permissions for the specified org and user.

Perms should be a dict of permissioning ids and permission levels.


target_user_validate

def target_user_validate(fnc)

Decorator function that ensures that the targeted user is a member of the targeted organization.

Should be below org_admin_required.

Also sets "user" in kwargs.