Foren

Organization Role vs Regular Role

Mark Renton, geändert vor 15 Jahren.

Organization Role vs Regular Role

New Member Beiträge: 17 Beitrittsdatum: 24.06.07 Neueste Beiträge
Hi,

I'm planning to customize a portal.
I've created organization hierarchy without problems, but now I want to generate roles.

I've two options:

* Create Regular Role and then
- Assign organization as a member and then assign the user to the organization
- Pros: I can view the users of the role
- Problem: Define Permisions to the role are in scope mode.....

* Create Organization Role and then
- Assign Organization roles to users
- Pros: Inheritance role permissions, define portlet permisions by role and by organization....
- Problem: I cann't view users by role !! Only if I view the user's profile->Organization roles.....


Any suggestions??


thanks!
thumbnail
Luke McLean, geändert vor 15 Jahren.

RE: Organization Role vs Regular Role

Junior Member Beiträge: 46 Beitrittsdatum: 16.08.07 Neueste Beiträge
Without know what you want to do with the roles Mark it will be very difficult for anyone to answer your question. What provisioning use cases are you considering... or are you trying to determine roles in the absence of use (form before function)?
Mark Renton, geändert vor 15 Jahren.

RE: Organization Role vs Regular Role

New Member Beiträge: 17 Beitrittsdatum: 24.06.07 Neueste Beiträge
Thanks for your answer.

I know the organizations that compose my application, then I create that organizational structure.

And there are some kind of users, example:

* OrganizationA
****SubOrganizationA1
------UsersType1
------UsersType2
****SubOrganizationA2
------UsersType1
* OrganizationB
****SubOrganizationB1
------UsersType1
****SubOrganizationB2
------UsersType2
------UsersType3
* OrganizationC
****SubOrganizationC1
------UsersType2
****SubOrganizationC2
------UsersType1
------UsersType3


My doubt is the following one:
the UsersType that I'm managing should be OrganizationRoles or RegularRoles + UsersGroups ?

Whichever way I choose, I've the problems that I've post above.
thumbnail
Manish Kumar Jaiswal, geändert vor 13 Jahren.

RE: Organization Role vs Regular Role

Regular Member Beiträge: 153 Beitrittsdatum: 25.11.08 Neueste Beiträge
Can any body help me getting Organization role through code...

How can I get it through Liferay API...
Venkat Koppavolu, geändert vor 13 Jahren.

RE: Organization Role vs Regular Role

Junior Member Beiträge: 85 Beitrittsdatum: 26.07.10 Neueste Beiträge
Manish Kumar Jaiswal:
Can any body help me getting Organization role through code...

How can I get it through Liferay API...


1. To get organizationRoles byusing Liferay's API

int type=3;
String subtype = StringPool.BLANK;
try{
List<Role> organizationRoles = RoleLocalServiceUtil.getRoles(type, subtype);
Iterator<Role> roleIterator = organizationRoles.iterator();
while(roleIterator.hasNext()){
Role organizationRole = roleIterator.next();
System.out.println("organizationRole Name" + organizationRole.getName() + "organizationRoleID::" + organizationRole.getRoleId());
}
}catch(Exception e){

}


2. To check User Has OrganizationRole or not

public Role getUserOrganizationRole(User user){
List<Role> userRoles = user.getRoles();
Iterator<Role> roleIterator = userRoles.iterator();
while(roleIterator.hasNext()){
Role role = roleIterator.next();
//OrganizationRole has type as'3'
if(role.getType() == 3){
//depending on your return type u can pass values
//retrun role.getRoleId();
//retrun role.getName();
return role;
}
}
}

3. If both above two solution's doesn't wotk, u can depend on

RoleLocalServiceUtil.dynamicQuery(DynamicQuery);

Hope this will help you..

Thanks,
Venkat
du du, geändert vor 12 Jahren.

RE: Organization Role vs Regular Role

New Member Beiträge: 4 Beitrittsdatum: 20.03.11 Neueste Beiträge
and how to add role for user in organization .i just know the way to add role in current role .emoticon
Brendan Kim, geändert vor 12 Jahren.

RE: Organization Role vs Regular Role

New Member Beiträge: 4 Beitrittsdatum: 17.11.11 Neueste Beiträge
Hi Manish,

At [2. To check User Has OrganizationRole or not],

List<Role> userRoles = user.getRoles();

returns only REGULAR type roles according to my test. Please correct me if I'm wrong.

Thanks,
Brendan
Seyed Yousef Hosseini, geändert vor 12 Jahren.

RE: Organization Role vs Regular Role

New Member Beiträge: 3 Beitrittsdatum: 24.06.11 Neueste Beiträge
try this
Roles = UserGroupRoleLocalServiceUtil.getUserGroupRoles(user.getUserId());


then role.getRole().getType will gives you the types.

Regards,
Seyed Yousef Hosseini
uozef@mexuz.com
http://www.mexuz.com
Amod Mulay, geändert vor 12 Jahren.

RE: Organization Role vs Regular Role

New Member Beiträge: 3 Beitrittsdatum: 02.03.12 Neueste Beiträge
you are right ;) Brendan
thumbnail
Prakash Khanchandani, geändert vor 11 Jahren.

RE: Organization Role vs Regular Role

Expert Beiträge: 329 Beitrittsdatum: 10.02.11 Neueste Beiträge
Manish Kumar Jaiswal:
Can any body help me getting Organization role through code...

How can I get it through Liferay API...


I know this is quite late but it might help some new comers and you in the future emoticon

This is not at all a good practice to hijack somebody else's thread i.e. ask a completely different (unlinked) question to the original discussion. You should have created your own post, it also helps those who are searching for a solution to the same problem as you are.

Thanks
Venkat Koppavolu, geändert vor 13 Jahren.

RE: Organization Role vs Regular Role

Junior Member Beiträge: 85 Beitrittsdatum: 26.07.10 Neueste Beiträge
Mark Renton:
Thanks for your answer.

I know the organizations that compose my application, then I create that organizational structure.

And there are some kind of users, example:

* OrganizationA
****SubOrganizationA1
------UsersType1
------UsersType2
****SubOrganizationA2
------UsersType1
* OrganizationB
****SubOrganizationB1
------UsersType1
****SubOrganizationB2
------UsersType2
------UsersType3
* OrganizationC
****SubOrganizationC1
------UsersType2
****SubOrganizationC2
------UsersType1
------UsersType3


My doubt is the following one:
the UsersType that I'm managing should be OrganizationRoles or RegularRoles + UsersGroups ?

Whichever way I choose, I've the problems that I've post above.



UsersType1 users will have both Regular Role and organizationRole.

User is created into LR he has Regular Role(defaultly User ]
If you assigned to organization/community then organization/community roles will get [ defaultly organization/community memmber ] to access particular group.. Once you disassocation with those things organization/community roles will gone and you have still regular role.

Thanks,

Venkat