Foren

All login-ed users are able to see my private pages

Alex Man, geändert vor 6 Jahren.

All login-ed users are able to see my private pages

Junior Member Beiträge: 70 Beitrittsdatum: 08.02.16 Neueste Beiträge
I have a requirement in which each login-ed user will be allowed to create their own private pages and manage the portlets for his purpose.
As per the requirement the layout page is created through api like as shown below


Liferay.Service(
  '/layout/add-layout',
  {
    groupId: 10233,
    privateLayout: true,
    parentLayoutId: 0,
    name: 'My Personal Page 1',
    title: 'My Personal Page 1',
    description: 'My Personal Page 1',
    type: 'portlet',
    hidden: false,
    friendlyURL: '/my-personal-page-1'
  },
  function(obj) {

  }
);


I am able to create the private page but the problem is that all logined users are able to see my private pages and its content.

I want no other user to see my private pages which I have created for my purpose.

Can anyone please help me on this. I am using Liferay 6.2 GA6
thumbnail
Andrew Jardine, geändert vor 6 Jahren.

RE: All login-ed users are able to see my private pages

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Alex,

Without knowing all the details, I would guess that what you are doing is adding a "private" page to the GROUP site, not the USER site. In case you are not aware (or the next person that comes along to read this is not aware) "sites" in Liferay have different meaning in different context. We start at the top with a Portal Instance (or company). This is identified using the domain. When you start Liferay for the first time, it will create the default portlet instance -- by default, it is called Liferay and referenced at localhost. When you create a "portal instance", a default site (or group) is created as part of the process. The default site is identified as "Guest" .. which is why you go to /web/guest for public pages and /group/guest for private ones. As you mentioned, you have to be logged in to see the /group friendly urls.

Now, by default, each user that is created has a possibility of two sites created for them. The first is a public "user" site, the second is a "private" user site. The public ones anyone can see ... usually as /web/<userId> .. but the private ones are just for the user. These are different sites (or groups) so they actually have their own unique identifiers. A user private site is normally where a user has the control to build their "site" as they see fit.

So in your example, when you use --

Liferay.Service(
  '/layout/add-layout',
  {
    groupId: 10233,


is that the group id for the Community Site (eg: /group/guest)? or are you passing the groupId for the USER site? If it is the former that you are using (the /group/guest id) then that is why all the other logged in users are also able to see the pages.