Issues with accessing /apps path | Community
Skip to main content
Level 6
March 28, 2024
Question

Issues with accessing /apps path

  • March 28, 2024
  • 1 reply
  • 1032 views

Hello Community - We have some issues with accessing /apps path for the anonymous user. We have few components in our project in those component, we are using multiple references of /apps paths in it(i.e. See below). If we access the page as a logged in user, we are able to see the component but if we access the same page as an anonymous user using the publish url, we don't see the component.

 

Since the /apps path read access is restricted for anonymous user so we don't see the component loading on the page. If we grant read access to everyone group, we started seeing the component. I know we shouldn't grant any read permissions to /apps path due to security aspects, it is related to clientlibs, we can specify allowProxy so that we can access it using /etc.clientlibs but in this case it's not clientlibs, so can someone tell me how to address this scenario. also please note that creating service user and grant read access is not an option for this usecase.

<sly data-sly-use.test="/apps/project/components/content/.../test.html"/>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Level 7
March 28, 2024

Hi @test1234567 

 

If you want to refer other component, then try below statement.

 

<sly data-sly-resource="${'image' @ resourceType='weretail/components/content/image'}"></sly>

<div data-sly-resource="${'/content/abc/us/en/author'}"></div>

Level 6
March 28, 2024

We already using the reference like below in the html, should we need to remove the /apps/ reference the below? We have to use data-sly-use only as we need this object to use it.

<sly data-sly-use.clientlib="/apps/project/components/content/sightly/templates/clientlib.html"  />

Level 7
March 29, 2024

Hi @test1234567 

 

Can you try this code snippet?

Created a component in we-retail project
/apps/weretail/components/content/maddy
 
maddy.html has sentence:  Hello World
 
 
My component
/apps/practice/components/dynamicComponent
 
dynamicComponent.html has this content.
 

 

 

<div data-sly-resource="${ 'sample' @ resourceType='weretail/components/content/maddy', appendPath='/*', decorationTagName='div',
cssClassName='cmp-helloworld__item'}"
data-sly-test="${(wcmmode.edit || wcmmode.preview || wcmmode.disabled) }"></div>
 
This worked in my local publish environment for anonymous user

Hi @test1234567 

Sometimes, because of the div class or the style, text may not be visible. In this case, try to put some alert or console statement in your  /apps/project2/components/content/module/module.html file