掲示板

groups_usergroups table

8年前 に Angelo Costa によって更新されました。

groups_usergroups table

New Member 投稿: 8 参加年月日: 15/07/03 最新の投稿
Hi,

Does anyone know what class i should use in liferay's api to access groups_usergroups table.

Thanks in advance,
8年前 に Angelo Costa によって更新されました。

RE: groups_usergroups table

New Member 投稿: 8 参加年月日: 15/07/03 最新の投稿
RE: groups_usergroups table
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: groups_usergroups table

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Angelo Costa:
RE: groups_usergroups table


This sentence no verb. ;)

Seriously: You don't want to change the database - even though you tricked and asked what API to use to change the database. Probably your underlying problem is not that you want to change the database. It's rather something like "I'd like to make somebody member of some group". That would be a problem with a solution that helps others as well.

Just the intention to change the database is an illegal request (and has been discussed to death in this forum and elsewhere). The database content is not your business. Even if you mask the question by asking for the API that does this change.
8年前 に Angelo Costa によって更新されました。

RE: groups_usergroups table

New Member 投稿: 8 参加年月日: 15/07/03 最新の投稿
Hello Olaf,

Regarding the empty reply, i think i submitted the form by mistake.

It was not my intention with this topic to gather information on our to change the database. I do not want to change the database at all. For that reason my apologies.

Rephrasing my initial request what i needed is to understand if a certain user belongs to a certain user group and if so the enable some buttons in the frontend.
For example: I have a user group called "workers" and added a user to this user group. How can i know if the current logged user belongs to this user group?

Thanks in advance,
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: groups_usergroups table

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
No apologies necessary - I just couldn't resist emoticon

My clarification was not only for you, but also for others that continue to ask about the database - not that everybody now rephrases their questions to ask for the API to change the database emoticon

Angelo Costa:
Rephrasing my initial request what i needed is to understand if a certain user belongs to a certain user group and if so the enable some buttons in the frontend.
For example: I have a user group called "workers" and added a user to this user group. How can i know if the current logged user belongs to this user group?


This question is a lot easier to answer (though, admitted, the naming is a bit of a mess)

The API methods for users and usergroups are in UserService, UserGroupService, or the equivalent local services. UserLocalService does not check any permissions, but for example you might want to look at UserLocalService.hasUserGroupUser.

The mess starts when you're getting to all the uses of "group" in that API: "Group" in the API is the technical name for a "Site" (simplified, but you'll get the point), so that "xxxxUserGroupXxxxx" might refer to a mapping of Users to Groups or the UserGroup. And even though I'm linking to the javadoc site, currently it's not the best documented class...

Another option, that would be more advanced and give you more flexibility: You might want to implement permissions - these can be granted per site, through roles. Roles might be assigned to individual users, usergroups or organizations. Ultimate flexibility and you'd use Liferay's permissionChecker to check if a certain permission is granted in the desired scope - through whatever means and memberships.
8年前 に Angelo Costa によって更新されました。

RE: groups_usergroups table

New Member 投稿: 8 参加年月日: 15/07/03 最新の投稿
Ok, thanks a lot for the input. I think now i'm able to move forward!
8年前 に Angelo Costa によって更新されました。

Re: [Liferay Forums][English] RE: groups_usergroups table

New Member 投稿: 8 参加年月日: 15/07/03 最新の投稿
Thanks Samuel. That helped alot.


Ângelo Costa

On Fri, Jul 3, 2015 at 11:24 AM, Samuel Kong from liferay.com <
forums@liferay.com> wrote:

>
> http://docs.liferay.com/portal/6.2/javadocs/com/liferay/portal/service/UserGroupLocalServiceUtil.html#addGroupUserGroup%28long,%20long%29
>
>
> To view the thread, follow the link below:
>
> https://www.liferay.com/community/forums/-/message_boards/view_message/55902154
> --
> Liferay.com <https://www.liferay.com>