Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Omkar Khandare
How assign Organization role through code.?
3 juillet 2013 22:53
Réponse

Omkar Khandare

Rang: Junior Member

Publications: 40

Date d'inscription: 6 mars 2012

Publications Récentes

Currenlty i am using liferay 6.1 CE
I have customized registration using EXT plugin,
Now i want to assign users to an organization & assign an organization role to same users.

Now i need to know which API can be used to assign specific Organization role to User.

How we can achieve it.?

Please Help.
Apoorva Prakash
RE: How assign Organization role through code.?
3 juillet 2013 23:14
Réponse

Apoorva Prakash

Rang: Liferay Master

Publications: 659

Date d'inscription: 15 juin 2010

Publications Récentes

Omkar Khandare:
Currenlty i am using liferay 6.1 CE
I have customized registration using EXT plugin,
Now i want to assign users to an organization & assign an organization role to same users.

Now i need to know which API can be used to assign specific Organization role to User.

How we can achieve it.?

Please Help.


Hi Omkar,

Hope the following code can help you:
1long organizationsIds[] = new long[2];
2organizationsIds[0] = 11013;
3organizationsIds[0] = 11014;
4UserLocalServiceUtil.updateOrganizations(user.getUserId(), organizationIds);


HTH...

Thanks and Regards,
Apoorva Prakash
Sachin Dhus
RE: How assign Organization role through code.?
3 juillet 2013 23:41
Réponse

Sachin Dhus

Rang: Junior Member

Publications: 40

Date d'inscription: 25 avril 2012

Publications Récentes

Omkar Khandare:
Currenlty i am using liferay 6.1 CE
I have customized registration using EXT plugin,
Now i want to assign users to an organization & assign an organization role to same users.

Now i need to know which API can be used to assign specific Organization role to User.

How we can achieve it.?

Please Help.


Hi Omkar,
Try this
1
2UserGroupRoleLocalServiceUtil.addUserGroupRoles(userIds, groupId, roleId)


Regards,
Sachin
Omkar Khandare
RE: How assign Organization role through code.?
3 juillet 2013 23:52
Réponse

Omkar Khandare

Rang: Junior Member

Publications: 40

Date d'inscription: 6 mars 2012

Publications Récentes

I used UserGroupRoleLocalServiceUtil.addUserGroupRoles(userIds, groupId, roleId)
previously for assigning site role of Guest group.

Yeah i will try with the same,
hope it will work for Organization also.

Thanks.