当前位置: 首页>>代码示例>>Python>>正文


Python Admin.GroupManagement类代码示例

本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Admin.GroupManagement的典型用法代码示例。如果您正苦于以下问题:Python GroupManagement类的具体用法?Python GroupManagement怎么用?Python GroupManagement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GroupManagement类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: putGroup

 def putGroup(self, group, user=None):
     """ Creates a group, or if a user is passed, adds that user to the group """
     if(user != None):
         # assume group exists and add user to it
         return GroupManagement.addUserToGroup(user, group)
     if GroupInfo.groupExists(group):
         return "Group already exists"
     GroupManagement.addGroup(group)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:8,代码来源:ReqMgrRESTModel.py

示例2: deleteUser

 def deleteUser(self, user):
     """ Deletes a user, as well as deleting his requests and removing
         him from all groups """
     if user in self.getUser():
         requests = json.loads(self.getUser(user))['requests']
         for request in requests:
             self.deleteRequest(request)
         for group in GroupInfo.groupsForUser(user).keys():
             GroupManagement.removeUserFromGroup(user, group)
         return UserManagement.deleteUser(user)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:ReqMgrRESTModel.py

示例3: getGroup

 def getGroup(self, group=None, user=None):
     """ No args lists all groups, one args returns JSON with users and priority """
     if group != None:
         result = {}
         result['users'] =  GroupInfo.usersInGroup(group)
         result['priority'] = GroupManagement.getPriority(group)
         return json.dumps(result)
     elif user != None:   
         return GroupInfo.groupsForUser(user).keys()
     else:
         return GroupInfo.listGroups()
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:11,代码来源:ReqMgrRESTModel.py

示例4: deleteGroup

 def deleteGroup(self, group, user=None):
     """ If no user is sent, delete the group.  Otherwise, delete the user from the group """
     if user == None:
         return GroupManagement.deleteGroup(group)
     else:
         return GroupManagement.removeUserFromGroup(user, group)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:6,代码来源:ReqMgrRESTModel.py

示例5: handleAddToGroup

 def handleAddToGroup(self, user, group):
     """ Adds a user to the group """
     self.validate(user)
     self.validate(group)
     GroupManagement.addUserToGroup(user, group)
     return "Added %s to %s " % (user, group)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:6,代码来源:Admin.py

示例6: handleAddGroup

 def handleAddGroup(self, group):
     """ Handles adding a group """
     self.validate(group)
     GroupManagement.addGroup(group)
     return "Added group %s " % group
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:5,代码来源:Admin.py

示例7: handleGroupPriority

 def handleGroupPriority(self, group, groupPriority):
     """ Handles setting group priority """
     self.validate(group)
     GroupManagement.setPriority(group, groupPriority)
     return "Updated group %s priority to %s" % (group, groupPriority)
开发者ID:stuartw,项目名称:WMCore,代码行数:5,代码来源:Admin.py

示例8: group

 def group(self, groupName):
     """ Web page of details about the user, and sets user priority """
     self.validate(groupName)
     users = GroupInfo.usersInGroup(groupName)
     priority = GroupManagement.getPriority(groupName)
     return self.templatepage("Group", group=groupName, users=users, priority=priority)
开发者ID:stuartw,项目名称:WMCore,代码行数:6,代码来源:Admin.py


注:本文中的WMCore.RequestManager.RequestDB.Interface.Admin.GroupManagement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。