
Hi @Christos Christopoulos,Do you want to eliminate the gear icon?
Please try to use the SPFX extension:
Before using the SPFX extension, we need to configure the environment:
Please refer to the link below to create in order:
References:
Setup Environment: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
Build an extension: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/build-a-hello-world-exte...
Then arrive at the sharepoint page, press F12, open the developer mode, we need to find the ID of the icon in the page:
Get the ID through JS code, and then remove
Here is code:
const canEdit = this.context.pageContext.web.permissions.hasAnyPermissions(SPPermission.manageWeb);
if (canEdit) {
let checkExist = setInterval(function () {
const element = document.querySelector("#O365_MainLink_Settings_container").firstChild.firstChild.firstChild.firstChild;
element.parentElement.parentElement.parentElement.remove();
console.log("GFC user only has view rights.");
clearInterval(checkExist);
}, 100);
}
Finally execute the SPfx extension
Here is result:
If you want to control its existence based on permissions, please try the method under this link
Hope these could help you!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards
Cheng Feng