function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GoldiGoldi 

Visualforce Page - Insufficient privilege

I have created a visualforce page to display google satellite view in leads page layout for certain profiles. However, user receives an error that she/he has insufficient privileges - in that spot, where the map should be. Me as the admin, I am able to see the new layout addition once I create a lead via certain profile. Could you please advise me, what could be the issue. Thank you 
Edgar MoranEdgar Moran
Hi Ilvija,

Have you cheked in the Visualforce security section, the other profiles can't access are included? you can check it in Setup > Development >Visualforce Pages and see something like this:

User-added image

User-added image

Best
Amit Chaudhary 8Amit Chaudhary 8
 1Go to Setup ---->Go to Setup | Manage Users | Profiles.
 2Select the User----> Select the name / profile of the affected user.
 3Go to the Access Page---->Select ' Visualforce Page Access'.
 4Edit--->Click Edit.
 5Make the required changes--->Make sure to add all ' Available Visualforce Pages'  to the Enabled Visualforce Pages section.
 6Save --->Save settings.

Let us know if this will help you
GoldiGoldi
Thank you for your answers!
It was the security section, now user no longer have te Insufficient priveledge error, however, the map thet they suppose to see is empty.

Code that I used:
User-added image

me as an admin, I no longer see the map as well. Any ideas appreciated!
Amit Chaudhary 8Amit Chaudhary 8
PLease post your code in here ( paste your code here)
GoldiGoldi
<apex:page standardController="lead"> 
<html>
 <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no"></meta>
    <meta charset="utf-8"></meta>
    <title>Simple markers</title>
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 2px;
        padding: 2px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
    <script>
    
//JS function to initialize Google Map     
function initialize() {
  var geocoder= new google.maps.Geocoder();

  var address = "{!lead.Street}, " + "{!lead.City}, " + "{!lead.PostalCode}, " + "{!lead.Country}";
  
  geocoder.geocode( { 'address': address}, function(results, status){
  if (status == google.maps.GeocoderStatus.OK) {
      
      var myLatlng = results[0].geometry.location;
      //alert(results[0].geometry.location)
      var mapOptions = {
        zoom: 23,
        center: myLatlng
      }
      var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

      var marker = new google.maps.Marker({
          position: myLatlng,
          map: map,
          title: '{!lead.Street}'
      });
    }
   //else {
       //alert("The google maps geocoding operation failed due to: " + status);
  
  } 
  
});
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  
  <body>
    <div id="map-canvas" style="width: 1000px; height: 1000px"></div>
  </body>
</html>
</apex:page>