def __buildRolesAndGroups(self): """Rebuild the cache dictionary for VOMS roles and EiscatDIRAC Groups""" self.lastBuild = datetime.datetime.now() allGroups = getAllGroups() for grpName in allGroups: vomsRole = getGroupOption(grpName, "VOMSRole") if vomsRole: self.diracGroups[grpName] = vomsRole self.vomsRoles.setdefault(vomsRole, []).append(grpName)
def __buildRolesAndGroups(self): """ Rebuild the cache dictionary for VOMS roles and DIRAC Groups""" self.lastBuild = datetime.datetime.now() allGroups = getAllGroups() for grpName in allGroups: vomsRole = getGroupOption(grpName, "VOMSRole") if vomsRole: self.diracGroups[grpName] = vomsRole self.vomsRoles.setdefault(vomsRole, []).append(grpName)
def getScopeGroups(self, scope: str) -> list: """Get DIRAC groups related to scope""" groups = [] for group in getAllGroups(): if (g_scope := self.getGroupScopes(group)) and set(g_scope).issubset(scope_to_list(scope)): groups.append(group)