Pular para o conteúdo principal

Adicionando "owners" para todas as comunidades

Here's another administration script to cover a common request to add a particular user (e.g. an administrator) to the ACL for every community. We can do this using two wsadmin commands:
  • CommunitiesService.fetchAllComms()
  • CommunitiesService.addMembersToCommunityByEmail()
In environments with many communities, you'd want to use CommunitiesService.fetchBatchComm() instead of retrieving them all in one shot, and that would require some additional code to handle the batches that I won't illustrate here. In the simple approach, you can just combine these two commands with a bit of glue to yield the following:

from java.util import ArrayList

# Initialize Communities Administration
execfile("communitiesAdmin.py")

# Define the new owner to add
newOwnerList = ArrayList()
newOwnerList = ["admin@ibm.com"]

# Get all communities
comms = CommunitiesService.fetchAllComm()

# Loop through the communities and add the new owner to each
for comm in comms:
    CommunitiesService.addMembersToCommunityByEmail(comm["uuid"],1,newOwnerList)

In the real world, I'd pass in the email address of the user to add as an argument to the command, but you get the idea. The addMembersToCommunityByEmail() command can use the community name instead of UUID, but we already have the UUID from fetchAllComms(), so it's better to use that and avoid name collisions that would result in an error.


Also note that because fetchAllComms() returns communities and subcommunities in indeterminate order, you'll need to run the command twice to cover the scenario where we try to update the ACL for a subcommunity before the user has been added to the parent community. The first pass will update all parent communities and any subcommunities processed after their parents, and the second pass will catch any of the subcommunities that were processed before their parents.

by Chad Scott

Comentários

Postagens mais visitadas deste blog

Running Domino Administrator and Domino Designer on a MAC

I'm running Domino Designer and Domino Administrator on macOS Catalina 10.15.3. Prerequisites : - CrossOver 19.0.1 - Domino 10.01 Client Installer Steps : 1. create a bottle with Windows 7 32 bit 2. Install:     - Main sources     - Adobe Flash 18     - Visual C ++ 2005 8.0 SP1     - SDK 1.1 3. Install Domino 10 client Problems :    - eventually an error message appears with a window, just click ok Tips :    - when executing the designer for the first time, note that there will be a hidden window, which prevents you from clicking on the operation. Check not to warn anymore and it's ok.

How to install HCL Sametime V11

How to install  Sametime V10  - a series of blog posts by  Gabriella Davis : Installing Sametime V10 Limited Use  (including MongoDB) Installing Sametime V10 - The Proxy Server  (WAS based Proxy Server) How to install  Sametime V11 Official documentation How to set autostart for Sametime V11 Proxy Server (Tomcat):  Windows ,  Linux How to enable  business cards photos Configuring  Sametime V11  - a series of blog posts by  Roberto Boccadoro : Integrating Sametime 11 with iNotes and Verse on Premises How to allow access to mobile clients Enabling person photo in the client  (and related problem  solution ) What to do if file transfer is not working Replace self-signed certificate in Sametime...

Querendo aprender Design Thinking?

Segue uma lista interessante para você sobre Design Thinking. Canal do You Tube - Rodrigo Giaffredo https://www.youtube.com/channel/UCiZGIBd46d1EiVvlMVxkmkA?sub_confirmation=1 EXTERNAL RESOURCES IBM Design Thinking http://www.ibm.com/design/thinking/ IBM Design Language http://www.ibm.com/design/language/inspiration How It Works: Design Thinking - IBM Think Academy https://www.youtube.com/watch?v=pXtN4y3O35M Tim Brown: Designers -- think big! http://www.ted.com/talks/tim_brown_urges_designers_to_think_big#t-14620 IDEO Design Thinking http://designthinking.ideo.com/ Using Design Thinking to Design Business Models: http://labs.sogeti.com/using-design-thinking-to-design-business-models/ Remote Design Thinking https://medium.com/remote-design-thinking d.school bootcamp bootleg http://dschool.stanford.edu/wp-content/uploads/2011/03/BootcampBootleg2010v2SLIM.pdf Design Kit Org http://www.designkit.org/ http://www.designkit.org/methods The Field Guide to Human-Centered Design http://www.des...