legacy-knowledge-base
公開されました Jun. 30, 2025

データベースからサイト名、サイトメンバー、サイトロールを参照する方法

written-by

Shimada Taro

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • データベースからサイト名、サイトメンバー、サイトロールを参照する方法を教えてください

環境

  • DXP 7.0+

解決

  • サイト名
    「Group_.name」をご参照ください。
  • サイトメンバー名
    「Users_Groups」をご参照ください。
    1行ごとに、ユーザーIDと所属するサイトIDが対になっています。

    Users_Groups.groupId = Group_.groupId
    Users_Groups.userId = User_.userId
  • サイトメンバー権限
    サイトロールに限らず、各ユーザーが持つロールが「Users_Roles」で管理されます。
    1行ごとに、ユーザーIDと付与されているロールIDが対になっております。

    Users_Roles.roleId = Role_.roleId
    Users_Roles.useId = User_.userId
    となります。
  • サイトで利用されているロール
    「UserGroupRole」テーブルで管理されます。それぞれ
    userId:ユーザーID
    groupId:サイトID
    roleId:ロールID
    となっております。

    「UserGroupRole」テーブルから「Site Administrator」に該当するroleIdを検索し、userIdgroupIdから、ユーザーとサイトを参照できます。
did-this-article-resolve-your-issue

legacy-knowledge-base