當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。