cancel
Showing results for 
Search instead for 
Did you mean: 

Creating users and groups

birgir
Champ in-the-making
Champ in-the-making
I want to have a script that sets my basic alfresco setup. This means creating users, groups and spaces. Using webservices I managed to create users and spaces but couldnt fint out how to create groups. Using Webscripts I cant see how I can create users. How would you go about this and is there no way to create users using the javascript API ?
8 REPLIES 8

kumbach
Champ in-the-making
Champ in-the-making
You can't add users AND groups using only web scripts or web services. You need to use both to accomplish that task.

I've been struggling with Alfresco for many months and I'm now in the opinion that any serious customization coding for Alfresco should be done using their Foundation Services. I'm tired of running into the situation where I need to do something but guess what, that feature isn't implemented in Web Scripts or Web Services. With the Foundation Services, you have everything at your disposal and won't be as limited as with scripts & services.

I'd also like to suggest that instead of writing code to populate users, groups, spaces, templates, etc., look into using AMPs. I've found it takes less time to create the XML files to import things rather than writing code to do the same thing. This is proving useful for us to initially load our default setup into a clean install of Alfresco.

I hope this helps…
Kevin

birgir
Champ in-the-making
Champ in-the-making
Thanks Kevin

It was a big help. Good to get a second opinion. I share your views and will reduce the frustrating search of functions and examples and rely more on the foundation services. Using AMPs for the setup sounds like a good idea.

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi,

You can also create your own JavaScript API for users creation. You need to create a spring bean to do this, but this is quite simple to do with the foundation services. Afterwards you can use this API from JavaScript. For the creation and modification of groups there is no specific API in the WebService API, but you can manage this by creating the expected nodes in the user://alfrescoUserStore under the /sys:system/sys:authorities node. Have a look at these nodes using the Node Browser. You can do all this with WebScripts too as they can be backed by a Spring bean…

Links:

janv
Employee
Employee
>> For the creation and modification of groups there is no specific API in the WebService API

FYI, if you still wish to use Web Services (rather than move to Web Scripts) then it should be possible to manage groups (authorities) using the HEAD version of the AccessControl WebService. Although the wiki page appears to be out-of-date, here's a link to the related JavaDoc:

http://dev.alfresco.com/resource/docs/java/remote-api/org/alfresco/repo/webservice/accesscontrol/Acc...

Regards,
Jan

janv
Employee
Employee

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi Jan,

Thanks for the link. I already have moved to webscripts because of performances: WebServices are really too slow for me and it's so easy to create interesting things with WebScripts….

FYI, if you still wish to use Web Services (rather than move to Web Scripts) then it should be possible to manage groups (authorities) using the HEAD version of the AccessControl WebService. Although the wiki page appears to be out-of-date, here's a link to the related JavaDoc:

http://dev.alfresco.com/resource/docs/java/remote-api/org/alfresco/repo/webservice/accesscontrol/Acc...

Cedric

mzafer
Champ in-the-making
Champ in-the-making
Hi Cedric,

Just wanted to know your experience so far with Web scripts compared to Foundation APIs. We are planning to use embedded verison of alfresco and will involve lot of custom code. My experience with Foundation classes has been good so far, but since I am returning to alfresco after a hiatus, I read more recommendations to use webscripts. But concerned that using web scripts will impact the performance as it requires a HTTP request for each operation and may not fit well if I want to retrieve lot of data. Can you please share your thoughts.

Thanks
Zafer

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi Zafer,

I'm extending Alfresco both with webscripts and the foundation API. Webscripts are more for remote API definition or an easy way to extend the web client.
I can't tell you what is more appropriate for your project as I don't know what it is all about Smiley Wink

Regards,
Cedric