noc.ip.models.prefixaccess

Module Contents

class noc.ip.models.prefixaccess.PrefixAccess

Bases: noc.core.model.base.NOCModel

class Meta

Bases: object

verbose_name
verbose_name_plural
db_table = ip_prefixaccess
app_label = ip
unique_together = [['user', 'vrf', 'afi', 'prefix']]
ordering = ['user', 'vrf', 'afi', 'prefix']
user
vrf
afi
prefix
can_view
can_change
__str__(self)
clean(self)

Field validation :return:

classmethod user_can_view(cls, user, vrf, afi, prefix)

Check user has read access to prefix :param user: :param vrf: :param afi: :param prefix: :return:

classmethod user_can_change(cls, user, vrf, afi, prefix)

Check user has write access to prefix :param cls: :param user: :param vrf: :param afi: :param prefix: :return:

classmethod read_Q(cls, user, field='prefix', table='')

Returns django Q with read restrictions. Q can be applied to prefix :param user: :param field: :param table: :return: