{"id":3243,"date":"2024-11-14T17:08:32","date_gmt":"2024-11-14T17:08:32","guid":{"rendered":"https:\/\/sankhamtech.com\/index.php\/content\/india\/english\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/"},"modified":"2024-11-15T18:23:00","modified_gmt":"2024-11-15T18:23:00","slug":"best-practices-for-secure-and-efficient-resource-access","status":"publish","type":"page","link":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/","title":{"rendered":"Best Practices for Secure and Efficient Resource Access"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"3243\" class=\"elementor elementor-3243\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cef3e80 e-flex e-con-boxed e-con e-parent\" data-id=\"cef3e80\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-5bd417b e-con-full e-flex e-con e-child\" data-id=\"5bd417b\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-9179fe0 elementor-hidden-mobile elementor-widget elementor-widget-text-editor\" data-id=\"9179fe0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h6 style=\"text-align: center;\"><span style=\"text-decoration: underline;\">Lessons<\/span><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-91d2399 elementor-hidden-desktop elementor-hidden-tablet elementor-widget elementor-widget-text-editor\" data-id=\"91d2399\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h6 style=\"text-align: center;\"><a href=\"https:\/\/sankhamtech.com\/index.php\/content\/india\/english\/home\/free-courses\/aem-backend-concepts\/\"><span style=\"text-decoration: underline;\">Lessons<\/span><\/a><\/h6>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f78d047 elementor-hidden-mobile elementor-widget elementor-widget-darsanam_header_menu_widget\" data-id=\"f78d047\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"darsanam_header_menu_widget.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"darsanam-menu-wrapper \"><div class='hamburger-icon'> &nbsp; Menu<\/div><div class=\"menu-container\"><nav class='elementor-menu'><ul class='darsanam-menu-vertical'><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/github-link-for-the-entire-course\/'>Github Link for the Entire Course<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-how-the-internet-works\/'>[VIDEO LESSON] How the Internet Works<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-web-development-architecture-decoded\/'>[VIDEO LESSON] Web Development Architecture Decoded<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/introduction-to-content-management-systems\/'>Introduction to Content Management Systems<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/content-management-vs-experience-management\/'>Content Management vs Experience Management<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-what-is-adobe-experience-manager\/'>[VIDEO LESSON] What is Adobe Experience Manager?<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-how-to-obtain-adobe-experience-manager-aem-jar-from-adobe\/'>[VIDEO LESSON] How to Obtain Adobe Experience Manager (AEM) JAR from Adobe<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-installing-aem-jar\/'>[VIDEO LESSON] Installing AEM Jar<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/troubleshooting-common-issues-in-installing-aem-jar\/'>Troubleshooting Common Issues in Installing AEM JAR<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-author-and-publish-instances\/'>Understanding Author and Publish Instances<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/creating-and-editing-a-page-in-aem\/'>Creating and Editing a Page in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/find-where-page-is-saved-in-backend\/'>Find Where Page is Saved in Backend<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/aems-sling-framework-understanding-component-resolution-and-rendering\/'>AEM\u2019s Sling Framework: Understanding Component Resolution and Rendering<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-creating-a-hello-world-component-in-aem-using-crx-de\/'>[VIDEO LESSON] Creating a \u201cHello World\u201d Component in AEM Using CRX\/DE<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-jcr-in-the-context-of-aem\/'>Understanding JCR in the Context of AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/nodes-and-properties-in-jcr\/'>Nodes and Properties in JCR<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/jcr-sessions-and-workspaces\/'>JCR Sessions and Workspaces<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-sql2-queries-in-aem\/'>Understanding SQL2 Queries in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-and-using-aems-querybuilder-tool\/'>Understanding and Using AEM\u2019s QueryBuilder Tool<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/import-and-export-jcr-data-using-package-manager\/'>Import and Export JCR Data Using Package Manager<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/installing-aem-project-archetype\/'>Installing AEM Project Archetype<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/troubleshooting-common-post-deployment-issues-in-aem\/'>Troubleshooting Common Post-Deployment Issues in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-dialog-box-authoring-development\/'>[VIDEO LESSON] AEM Dialog Box Authoring & Development<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-htl-language-syntax-practice\/'>[VIDEO LESSON] AEM HTL Language Syntax Practice<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-htl-global-objects\/'>[VIDEO LESSON] AEM HTL Global Objects<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-htl-global-objects-contd\/'>[VIDEO LESSON] AEM HTL Global Objects (Contd.)<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-understanding-aem-dialog-box\/'>[VIDEO LESSON] Understanding AEM Dialog Box<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/creating-and-deploying-component-in-aem\/'>Creating and Deploying Component in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/create-various-dialog-box-fields\/'>Create Various Dialog Box Fields<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-sling-models-and-sightly-introduction\/'>[VIDEO LESSON] Sling Models and Sightly Introduction<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-sling-model-explained-with-real-use-case\/'>[VIDEO LESSON] Sling Model Explained with Real Use Case<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-resource-resolver-query-builder\/'>[VIDEO LESSON] AEM Resource Resolver & Query Builder<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-query-builder-java-beans\/'>[VIDEO LESSON] AEM Query Builder & Java Beans<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-add-css-to-aem-component\/'>[VIDEO LESSON] Add CSS to AEM Component<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-templates-components-authoring\/'>[VIDEO LESSON] AEM Templates & Components Authoring<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-add-css-variations-to-aem-component\/'>[VIDEO LESSON] Add CSS Variations to AEM Component<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/creating-a-multi-field-in-aem\/'>Creating a Multi-Field in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/creating-a-composite-multifield-in-aem\/'>Creating a Composite Multifield in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/implementing-conditional-dialog-fields\/'>Implementing Conditional Dialog Fields<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-creating-sling-models\/'>Best Practices for Creating Sling Models<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-introduction-to-aem-sling-servlet\/'>[VIDEO LESSON] Introduction to AEM Sling Servlet<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-headless-servlet-implementation\/'>[VIDEO LESSON] AEM Headless \u2013 Servlet Implementation<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-osgi-services-introduction\/'>[VIDEO LESSON] OSGI Services Introduction<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-aem-osgi-services-implementation\/'>[VIDEO LESSON] AEM OSGI Services Implementation<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lesson-filters-in-osgi-services\/'>[VIDEO LESSON] Filters in OSGI Services<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/calling-external-api-from-osgi-service\/'>Calling External API from OSGI Service<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/improving-aem-sling-model-with-service-layer-integration\/'>Improving AEM Sling Model with Service Layer Integration<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/' style='color: #FF7700 !important'>Best Practices for Secure and Efficient Resource Access<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/video-lessonstep-by-step-process-to-get-resource-resolver-from-system-user\/'>[VIDEO LESSON]Step By Step Process to Get Resource Resolver from System User<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/the-importance-and-use-cases-of-workflows\/'>The Importance and Use Cases of Workflows<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/introduction-to-workflow-creation\/'>Introduction to Workflow Creation<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-participant-step-in-aem\/'>Understanding Participant Step in AEM<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-workflow-steps\/'>Understanding Workflow Steps<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/understanding-workflow-steps-contd\/'>Understanding Workflow Steps [Contd.]<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/step-1-understand-aem-workflow-use-case\/'>Step 1: Understand AEM Workflow Use Case.<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/step-2-create-user-groups-and-assign-users\/'>Step 2: Create User Groups and Assign Users<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/step-3-create-new-page-properties\/'>Step 3: Create New Page Properties<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><li class='darsanam-menu-item'><a href='https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/workflow-example-code-below\/'>Workflow Example Code Below<\/a><i class=\"menu-icon-right fas fa-angle-right\"><\/i><\/li><\/ul><\/nav><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d599676 e-con-full e-flex e-con e-child\" data-id=\"d599676\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4d8330d elementor-widget elementor-widget-text-editor\" data-id=\"4d8330d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>Best Practices for Secure and Efficient Resource Access<\/h2><p><\/p><p>When you&#8217;re creating a website or an app using Adobe Experience Manager (AEM), you often need to fetch (get) data from the website&#8217;s content repository. This is a bit like accessing files and folders on your computer, but in this case, it&#8217;s for website content. To do this, you use something called a &#8220;ResourceResolver.&#8221; Think of the ResourceResolver as a key that helps you open doors to find the data you need.<\/p><p> <\/p><p>Now, in the provided code snippet, there&#8217;s a method that tries to get articles from the website. It uses the &#8220;ResourceResolver&#8221; to access the website&#8217;s data. However, the way it&#8217;s getting this &#8220;ResourceResolver&#8221; is by asking the &#8220;resource&#8221; (which represents a specific piece of content) for it.<\/p><p> <\/p><p>Here&#8217;s where things get tricky:<\/p><p> <\/p><pre class=\"wp-block-code\"><code>package com.adobe.aem.guides.wknd.core.services.impl;\n\nimport com.adobe.aem.guides.wknd.core.beans.ArticleListDataBean;\nimport com.adobe.aem.guides.wknd.core.services.ArticleListService;\nimport com.adobe.aem.guides.wknd.core.services.ResourceResolverService;\nimport com.day.cq.search.PredicateGroup;\nimport com.day.cq.search.Query;\nimport com.day.cq.search.QueryBuilder;\nimport com.day.cq.search.result.Hit;\nimport com.day.cq.search.result.SearchResult;\nimport com.day.cq.wcm.api.Page;\nimport org.apache.sling.api.resource.Resource;\nimport org.apache.sling.api.resource.ResourceResolver;\nimport org.osgi.service.component.annotations.Component;\nimport org.osgi.service.component.annotations.Reference;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport javax.jcr.RepositoryException;\nimport javax.jcr.Session;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\n@Component(service = ArticleListService.class)\npublic class ArticleListServiceImpl implements ArticleListService {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(ArticleListServiceImpl.class);\n\n    @Reference\n    private QueryBuilder builder;\n    \n\n    @Override\n    public List&lt;ArticleListDataBean&gt; getArticleListDataBeans(Resource resource, String articleRootPath) {\n        List&lt;ArticleListDataBean&gt; articleListDataBeans = new ArrayList&lt;&gt;();\n        ResourceResolver resourceResolver = resource.getResourceResolver();\n\n        Map&lt;String, String&gt; predicate = new HashMap&lt;&gt;();\n        predicate.put(\"path\", articleRootPath);\n        predicate.put(\"type\", \"cq:Page\");\n\n        try {\n            Query query = builder.createQuery(PredicateGroup.create(predicate), resourceResolver.adaptTo(Session.class));\n            SearchResult searchResult = query.getResult();\n\n            for (Hit hit : searchResult.getHits()) {\n                String path = hit.getPath();\n                Resource articleResource = resourceResolver.getResource(path);\n                Page articlePage = articleResource != null ? articleResource.adaptTo(Page.class) : null;\n\n                if (articlePage != null) {\n                    ArticleListDataBean articleListDataBean = new ArticleListDataBean();\n                    articleListDataBean.setPath(path);\n                    articleListDataBean.setTitle(articlePage.getTitle());\n                    articleListDataBean.setDescription(articlePage.getDescription());\n\n                    articleListDataBeans.add(articleListDataBean);\n                }\n            }\n        } catch (RepositoryException e) {\n            LOGGER.error(\"Error processing search result hit: {}\", e.getMessage(), e);\n        } catch (Exception e) {\n            LOGGER.error(\"Error executing query for path {}: {}\", articleRootPath, e.getMessage(), e);\n        }\n        return articleListDataBeans;\n    }\n}\n<\/code><\/pre><p> <\/p><h3 class=\"wp-block-heading\">Why Getting ResourceResolver Directly from a Resource is Not Right<\/h3><p> <\/p><p>Imagine you have a key (ResourceResolver) that you found lying around in a room (the &#8220;resource&#8221;). You use this key to open various doors within a building (the content repository) to get information. This key is supposed to be personal and controlled; it should only open doors you&#8217;re allowed to enter. But since you found it just lying around, you don&#8217;t really know if you&#8217;re supposed to have access to all these rooms. You might accidentally enter a room you&#8217;re not supposed to, which can lead to security issues.<\/p><p> <\/p><p>In technical terms, using a ResourceResolver directly from a resource means you&#8217;re using a key that&#8217;s not necessarily meant for you. It might have restrictions or might not be the right way to access certain information securely and efficiently.<\/p><p> <\/p><h3 class=\"wp-block-heading\">Why We Need to Get It from System Users<\/h3><p> <\/p><p>Going back to our building and key analogy, a better approach is to get a master key designed specifically for you (or for a specific task). This is what getting a ResourceResolver from system users is like. System users in AEM are special user accounts that are meant for specific tasks, like running services or accessing certain types of data. They are like trusted employees who have been given keys (ResourceResolvers) that open exactly the doors they need to for their work.<\/p><p> <\/p><p>So, when you get a ResourceResolver through a system user, you&#8217;re essentially getting a key that&#8217;s:<\/p><p> <\/p><ul class=\"wp-block-list\"><li><strong>Securely given to you<\/strong> for a specific purpose, ensuring you only access what you&#8217;re supposed to.<\/li> <li><strong>Optimized for performance<\/strong>, since it&#8217;s meant to do exactly what you need, without unnecessary access or overhead.<\/li><\/ul><p><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Lessons Lessons &nbsp; Menu Github Link for the Entire Course [VIDEO LESSON] How the Internet Works [VIDEO LESSON] Web Development Architecture Decoded Introduction to Content Management Systems Content Management vs Experience Management [VIDEO LESSON] What is Adobe Experience Manager? [VIDEO LESSON] How to Obtain Adobe Experience Manager (AEM) JAR from Adobe [VIDEO LESSON] Installing AEM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2868,"menu_order":47,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3243","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Best Practices for Secure and Efficient Resource Access - Sankham Technologies<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Best Practices for Secure and Efficient Resource Access - Sankham Technologies\" \/>\n<meta property=\"og:description\" content=\"Lessons Lessons &nbsp; Menu Github Link for the Entire Course [VIDEO LESSON] How the Internet Works [VIDEO LESSON] Web Development Architecture Decoded Introduction to Content Management Systems Content Management vs Experience Management [VIDEO LESSON] What is Adobe Experience Manager? [VIDEO LESSON] How to Obtain Adobe Experience Manager (AEM) JAR from Adobe [VIDEO LESSON] Installing AEM [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/\" \/>\n<meta property=\"og:site_name\" content=\"Sankham Technologies\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-15T18:23:00+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/best-practices-for-secure-and-efficient-resource-access\\\/\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/best-practices-for-secure-and-efficient-resource-access\\\/\",\"name\":\"Best Practices for Secure and Efficient Resource Access - Sankham Technologies\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#website\"},\"datePublished\":\"2024-11-14T17:08:32+00:00\",\"dateModified\":\"2024-11-15T18:23:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/best-practices-for-secure-and-efficient-resource-access\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/best-practices-for-secure-and-efficient-resource-access\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/best-practices-for-secure-and-efficient-resource-access\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Content\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"India\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"English\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Free Courses\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/index.php\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"AEM Backend Concepts\",\"item\":\"https:\\\/\\\/sankhamtech.com\\\/indexphp\\\/content\\\/in\\\/en\\\/home\\\/free-courses\\\/aem-backend-concepts\\\/\"},{\"@type\":\"ListItem\",\"position\":8,\"name\":\"Best Practices for Secure and Efficient Resource Access\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#website\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/\",\"name\":\"Sankham Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sankhamtech.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#organization\",\"name\":\"Sankham Technologies\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/sankhamtech.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/Logo-Dark-1.png\",\"contentUrl\":\"https:\\\/\\\/sankhamtech.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/Logo-Dark-1.png\",\"width\":306,\"height\":74,\"caption\":\"Sankham Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/sankhamtech.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Best Practices for Secure and Efficient Resource Access - Sankham Technologies","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/","og_locale":"en_US","og_type":"article","og_title":"Best Practices for Secure and Efficient Resource Access - Sankham Technologies","og_description":"Lessons Lessons &nbsp; Menu Github Link for the Entire Course [VIDEO LESSON] How the Internet Works [VIDEO LESSON] Web Development Architecture Decoded Introduction to Content Management Systems Content Management vs Experience Management [VIDEO LESSON] What is Adobe Experience Manager? [VIDEO LESSON] How to Obtain Adobe Experience Manager (AEM) JAR from Adobe [VIDEO LESSON] Installing AEM [&hellip;]","og_url":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/","og_site_name":"Sankham Technologies","article_modified_time":"2024-11-15T18:23:00+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/","url":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/","name":"Best Practices for Secure and Efficient Resource Access - Sankham Technologies","isPartOf":{"@id":"https:\/\/sankhamtech.com\/#website"},"datePublished":"2024-11-14T17:08:32+00:00","dateModified":"2024-11-15T18:23:00+00:00","breadcrumb":{"@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/best-practices-for-secure-and-efficient-resource-access\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sankhamtech.com\/"},{"@type":"ListItem","position":2,"name":"Content","item":"https:\/\/sankhamtech.com\/index.php\/content\/"},{"@type":"ListItem","position":3,"name":"India","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/"},{"@type":"ListItem","position":4,"name":"English","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/"},{"@type":"ListItem","position":5,"name":"Home","item":"https:\/\/sankhamtech.com\/"},{"@type":"ListItem","position":6,"name":"Free Courses","item":"https:\/\/sankhamtech.com\/index.php\/content\/in\/en\/home\/free-courses\/"},{"@type":"ListItem","position":7,"name":"AEM Backend Concepts","item":"https:\/\/sankhamtech.com\/indexphp\/content\/in\/en\/home\/free-courses\/aem-backend-concepts\/"},{"@type":"ListItem","position":8,"name":"Best Practices for Secure and Efficient Resource Access"}]},{"@type":"WebSite","@id":"https:\/\/sankhamtech.com\/#website","url":"https:\/\/sankhamtech.com\/","name":"Sankham Technologies","description":"","publisher":{"@id":"https:\/\/sankhamtech.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sankhamtech.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/sankhamtech.com\/#organization","name":"Sankham Technologies","url":"https:\/\/sankhamtech.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sankhamtech.com\/#\/schema\/logo\/image\/","url":"https:\/\/sankhamtech.com\/wp-content\/uploads\/2023\/12\/Logo-Dark-1.png","contentUrl":"https:\/\/sankhamtech.com\/wp-content\/uploads\/2023\/12\/Logo-Dark-1.png","width":306,"height":74,"caption":"Sankham Technologies"},"image":{"@id":"https:\/\/sankhamtech.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/comments?post=3243"}],"version-history":[{"count":7,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3243\/revisions"}],"predecessor-version":[{"id":3679,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/3243\/revisions\/3679"}],"up":[{"embeddable":true,"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/pages\/2868"}],"wp:attachment":[{"href":"https:\/\/sankhamtech.com\/index.php\/wp-json\/wp\/v2\/media?parent=3243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}