掲示板

Organization Role vs Regular Role

15年前 に Mark Renton によって更新されました。

Organization Role vs Regular Role

New Member 投稿: 17 参加年月日: 07/06/24 最新の投稿
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
15年前 に Luke McLean によって更新されました。

RE: Organization Role vs Regular Role

Junior Member 投稿: 46 参加年月日: 07/08/16 最新の投稿
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)?
15年前 に Mark Renton によって更新されました。

RE: Organization Role vs Regular Role

New Member 投稿: 17 参加年月日: 07/06/24 最新の投稿
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
13年前 に Manish Kumar Jaiswal によって更新されました。

RE: Organization Role vs Regular Role

Regular Member 投稿: 153 参加年月日: 08/11/25 最新の投稿
Can any body help me getting Organization role through code...

How can I get it through Liferay API...
13年前 に Venkat Koppavolu によって更新されました。

RE: Organization Role vs Regular Role

Junior Member 投稿: 85 参加年月日: 10/07/26 最新の投稿
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
13年前 に du du によって更新されました。

RE: Organization Role vs Regular Role

New Member 投稿: 4 参加年月日: 11/03/20 最新の投稿
and how to add role for user in organization .i just know the way to add role in current role .emoticon
12年前 に Brendan Kim によって更新されました。

RE: Organization Role vs Regular Role

New Member 投稿: 4 参加年月日: 11/11/17 最新の投稿
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
12年前 に Seyed Yousef Hosseini によって更新されました。

RE: Organization Role vs Regular Role

New Member 投稿: 3 参加年月日: 11/06/24 最新の投稿
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
12年前 に Amod Mulay によって更新されました。

RE: Organization Role vs Regular Role

New Member 投稿: 3 参加年月日: 12/03/02 最新の投稿
you are right ;) Brendan
thumbnail
11年前 に Prakash Khanchandani によって更新されました。

RE: Organization Role vs Regular Role

Expert 投稿: 329 参加年月日: 11/02/10 最新の投稿
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
13年前 に Venkat Koppavolu によって更新されました。

RE: Organization Role vs Regular Role

Junior Member 投稿: 85 参加年月日: 10/07/26 最新の投稿
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