내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Obtaining session apart from repository.loginAdministrative(null) way.

Avatar

Level 9

Hi All,

repository.loginAdministrative(null) is a deprecated method of obtaining a session instance. What would be an alternative that can be used here.

Any thoughts/pointers here, will be helpful.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee Advisor

You should use Sling service resource resolver for getting session in
backend services. This is now recommended for getting sessions as  it
restricts the access to the service code only on the required repository
paths unlike loginAdministrative which exposes full permissions to your
services. You can follow the below example-
https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html
 

원본 게시물의 솔루션 보기

4 답변 개

Avatar

Level 10

Avatar

정확한 답변 작성자:
Employee Advisor

You should use Sling service resource resolver for getting session in
backend services. This is now recommended for getting sessions as  it
restricts the access to the service code only on the required repository
paths unlike loginAdministrative which exposes full permissions to your
services. You can follow the below example-
https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html
 

Avatar

Level 9

Hi Kunal/Praveen,

Thank you for your replies.

Avatar

Employee

I need to unlock a page through code which is locked by another user. 

Do i need to create a service user similar to admin user which can be used to impersonate and unlock resources? How can this be achieved?