cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide Data Dictionary space from everyone except admin

alexr
Champ in-the-making
Champ in-the-making
Hi Kevin and Alfresco colleagues,

I have the following question:

If a user explores the Company Home space, I want him/her to
only see the spaces he/she has access to.
The Data Dictionary space is not a space I want everybody to browse
through.
The default permission on the Data Dictionary space is:
Everyone has the role: Consumer

I understand that some permissions are needed for all users to access
the documents (templates etc.) inside the Data Dictionary subspaces.

So what is the best practice to realize the "hiding" of the Data Dictionary
space?

Kind Regards,

Alex
3 REPLIES 3

mikeh
Star Contributor
Star Contributor

alexr
Champ in-the-making
Champ in-the-making
Thanks Mike,

I scripted the following:

- make all spaces in Data Dictionary not to inherit from parent's permission
- invite everyone as consumer in Data Dictionary child spaces
- remove the permission of the data dictionary space

and it works.

So now the "Data Dictionary" space will be hidden inside "Company Home" for all users except admin.

Regards,

Alex

ced
Champ in-the-making
Champ in-the-making
For info, here is the script I used with success.

//Hide data dictionary for all users except administrators

var datadictionary = companyhome.childByNamePath("Data Dictionary");
var list = datadictionary.children;

for (var i in list) {
   var child = list[i];
  
   child.setInheritsPermissions(false);
   child.setPermission("Consumer", "GROUP_EVERYONE");  
}

datadictionary.removePermission("Consumer");