cancel
Showing results for 
Search instead for 
Did you mean: 

How create User, Group, add User to Group in JavaScript1.4?

alexr
Champ in-the-making
Champ in-the-making
I plan to create a JavaScript for defining all groups and users and
adding users to one or more groups etc.
With a second JavaScript I plan to set permissions to nodes (folder spaces etc.) with the created groups (and users).
However I cannot find user, group functionality in the current JavaScript 1.4 WiKi.

Is this to be implemented through the Actions API?

Can you please give me a JavaScript 1.4 example how to:

1- Create a user (setting all properties (email etc.))
2- Create a group (again setting all properties)
3- Add the created user to the created group.

Thanks in advance,

Kind regards,

Alex
Smiley Happy
4 REPLIES 4

alexr
Champ in-the-making
Champ in-the-making
Is there any way at all to do this through JavaScript 1.4 :?:

Alex

kevinr
Star Contributor
Star Contributor
The Groups and Users API is not accessable through the JavaScript interface at present. You would need to implement a custom Java action and then call that from JavaScript which is quite possible.

Thanks,

Kevin

alexr
Champ in-the-making
Champ in-the-making
Hi Kevin,

That's a pity  :cry:

Could you give me a simple example how to implement a custom Java action to create User/Group or add user to a group and how to call that Java action from within the Alfresco JavaScript API?
I am not a very experienced Java developer, so I like to keep the customizations simple and clean without having to delve too deep in existing J2EE frameworks. Does it realy involves Java development (i.e. installing the Alfresco SDK, recompiling java code
etc.?) or is there a more convenient way of doing this.

Is the implementation of a User/Group JavaScript API already on the Roadmap for one of the next Alfresco releases?

Thanks,

Alex

jmliege
Champ in-the-making
Champ in-the-making
I am not a very experienced Java developer, so I like to keep the customizations simple and clean without having to delve too deep in existing J2EE frameworks

You should try to find out by yourself, or you'll never be an experienced java developer…

:idea: :idea: :idea:
First of all, you should check in which screen(s) Alfresco interface permits users to create user/group, then search for the backing beans…
:idea: :idea: :idea:

By the way, it's not so difficult to handle the user/groups creation in Alfresco, everything is done through Services.

Take a glance at the following classes:

org.alfresco.service.cmr.security.AuthorityService
org.alfresco.service.cmr.security.AuthorityType
org.alfresco.service.cmr.security.PermissionService
org.alfresco.service.cmr.security.PersonService

And if you really don't see what to do, check at last at the following classes:
org.alfresco.web.bean.GroupsBean

JM