How to Restrict Users from Accessing People Directory or Search Users from Quick Search
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Atlassian Support Offerings
The following approaches are considered Confluence customization that is beyond Atlassian Support Offerings. Atlassian will not be held liable for any errors or other unexpected events resulting from the use of the customization.
Hiding People Directory
You may apply the following steps to prevent users from accessing user information due to confidentiality.
- Access Confluence Admin or click the Cog icon, and choose General Configuration.
- Go to Look and Feel panel and click Layouts.
- Under the Site Layouts, search for Main Layout and click Edit/Create Custom.
- Find the following section:
<head>
and</head>
. Copy and paste the following code before
</head>
.#if ($userAccessor.hasMembership('<insert-group-with-access>', $helper.action.remoteUser.name)) #else <script type="text/javascript"> AJS.toInit(function(){ AJS.$('#people-directory-link').hide(); }); </script> #end
Save the changes.
Please replace the code: "<insert-group-with-access>" with the group that allowed to access the People Directory (i.e. confluence-administrators
).
Hiding Quick Search
User is still able to access the user information by searching the user in the Quick Search bar. Therefore, Quick Search bar is required to hide as well
- Access Confluence Admin or click the Cog icon, and choose General Configuration.
- Go to Look and Feel panel and click Layouts.
- Under the Site Layouts, search for Main Layout and click Edit/Create Custom.
- Find the following section:
<head>
and</head>
. Copy and paste the following code before
</head>
.#if ($userAccessor.hasMembership('<insert-group-with-access>', $helper.action.remoteUser.name)) #else <script type="text/javascript"> AJS.toInit(function(){ AJS.$('#quick-search-query').hide(); }); </script> #end
Insert the following code:
AJS.$('#quick-search-query').hide();
into the body if you have already apply the previous code.Save the changes.
Please replace the code: "<insert-group-with-access>" with the group that allowed to access the People Directory (i.e. confluence-administrators
).
There is an improvement request raised at CONF-7837 - Getting issue details... STATUS .