def allowed(self, request, security_group=None):
        if api.base.is_service_enabled(request, "network"):
            policy = (("network", "create_security_group"),)
        else:
            policy = (("compute", "compute_extension:security_groups"),)

        usages = quotas.tenant_quota_usages(request)
        if usages['security_groups']['available'] <= 0:
            if "disabled" not in self.classes:
                self.classes = [c for c in self.classes] + ["disabled"]
                self.verbose_name = _("Create Security Group (Quota exceeded)")
        else:
            self.verbose_name = _("Create Security Group")
            self.classes = [c for c in self.classes if c != "disabled"]

        return POLICY_CHECK(policy, request, target={})
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py/CreateGroup.allowed/original