Search code examples
liferayhookliferay-6liferay-themeliferay-aui

In which entity the User Group details and user Group roles will save?


With reference to following link, https://asifaftab87.wordpress.com/2014/09/22/create-usergroup-programmatically-in-liferay/ I have created the user groups programatically. I wanted to know that in which table in the database the User Group details and User group Roles will get save? If I wish can it possible to add the custom fields for User Group using Expando API?

Any suggestions please.


Solution

  • Users are stored in USER_ table:

    select * from USER_;
    

    Groups are stored in GROUP_ table:

    select * from GROUP_;
    

    Roles are stored in ROLE_ table:

    select * from ROLE_;
    

    Simple view of users and their groups:

    select USER_.USERID, USER_.SCREENNAME, USER_.EMAILADDRESS, GROUP_.NAME 
    from USER_, USERS_GROUPS, GROUP_ 
    where USER_.USERID = USERS_GROUPS.USERID and USERS_GROUPS.GROUPID = GROUP_.GROUPID
    order by USER_.SCREENNAME;
    

    Simple view of users and their roles:

    select USER_.USERID, USER_.SCREENNAME, USER_.EMAILADDRESS, ROLE_.NAME
    from USER_, USERS_ROLES, ROLE_ 
    where USER_.USERID = USERS_ROLES.USERID and USERS_ROLES.ROLEID = ROLE_.ROLEID
    order by USER_.SCREENNAME;
    

    Custom fields can be added for uses, groups and roles alike.