Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/c/o/commcare-hq-HEAD/corehq/apps/hqadmin/management/commands/cchq_prbac_bootstrap.py   commcare-hq(Download)
        """
 
        existing_roles = Role.objects.filter(slug=role.slug)
 
        if existing_roles:

src/c/o/commcare-hq-HEAD/corehq/apps/hqwebapp/models.py   commcare-hq(Download)
    def is_viewable(self):
        roles = Role.objects.filter(slug=privileges.ACCOUNTING_ADMIN)
        if not roles:
            return False
        privilege = roles[0].instantiate({})

src/c/o/commcare-hq-HEAD/corehq/apps/accounting/utils.py   commcare-hq(Download)
def domain_has_privilege(domain, privilege_slug, **assignment):
    from corehq.apps.accounting.models import Subscription
    try:
        plan_version = Subscription.get_subscribed_plan_by_domain(domain)[0]
        roles = Role.objects.filter(slug=privilege_slug)

src/d/j/django-prbac-0.0.2/django_prbac/decorators.py   django-prbac(Download)
                raise PermissionDenied()
 
            roles = Role.objects.filter(slug=slug)
            if not roles:
                raise PermissionDenied()