Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mark Renton
Organization Role vs Regular Role
October 17, 2008 5:49 AM
Answer

Mark Renton

Rank: New Member

Posts: 17

Join Date: June 24, 2007

Recent Posts

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!
Luke McLean
RE: Organization Role vs Regular Role
October 19, 2008 1:09 AM
Answer

Luke McLean

Rank: Junior Member

Posts: 46

Join Date: August 15, 2007

Recent Posts

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
RE: Organization Role vs Regular Role
October 20, 2008 12:22 AM
Answer

Mark Renton

Rank: New Member

Posts: 17

Join Date: June 24, 2007

Recent Posts

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.
Manish Kumar Jaiswal
RE: Organization Role vs Regular Role
December 28, 2010 5:12 AM
Answer

Manish Kumar Jaiswal

Rank: Regular Member

Posts: 133

Join Date: November 25, 2008

Recent Posts

Can any body help me getting Organization role through code...

How can I get it through Liferay API...
Venkat Koppavolu
RE: Organization Role vs Regular Role
December 28, 2010 8:43 AM
Answer

Venkat Koppavolu

Rank: Junior Member

Posts: 85

Join Date: July 25, 2010

Recent Posts

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
Venkat Koppavolu
RE: Organization Role vs Regular Role
December 28, 2010 8:49 AM
Answer

Venkat Koppavolu

Rank: Junior Member

Posts: 85

Join Date: July 25, 2010

Recent Posts

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
du du
RE: Organization Role vs Regular Role
May 3, 2011 10:42 PM
Answer

du du

Rank: New Member

Posts: 4

Join Date: March 20, 2011

Recent Posts

and how to add role for user in organization .i just know the way to add role in current role .emoticon
Brendan Kim
RE: Organization Role vs Regular Role
December 19, 2011 11:55 AM
Answer

Brendan Kim

Rank: New Member

Posts: 4

Join Date: November 17, 2011

Recent Posts

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
RE: Organization Role vs Regular Role
January 8, 2012 10:53 PM
Answer

Seyed Yousef Hosseini

Rank: New Member

Posts: 3

Join Date: June 24, 2011

Recent Posts

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
RE: Organization Role vs Regular Role
March 2, 2012 6:56 AM
Answer

Amod Mulay

Rank: New Member

Posts: 3

Join Date: March 2, 2012

Recent Posts

you are right ;) Brendan
Prakash Khanchandani
RE: Organization Role vs Regular Role
July 27, 2012 3:06 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

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