[mapguide-users] please clarify user authentication issues

poy poychris at gmail.com
Tue Sep 9 09:41:11 EDT 2008


Hi All,

I have a weblayout, the map definition of which is in a map folder with
permissions to access only by the admistrator user group. I also created a
Invoke URL command which calls an aspx page in the task pane. In the aspx
page I am trying to get the list of layers in the map. My code in the aspx
page is as follows:

             //get session id from map request
               string sessionId = Request.Form["SESSION"];
               string mapName = Request.Form["MAPNAME"];

               
               //initialize web tier
               myclass util = new myclass();
               util.initialiseWebTier();

               //set credentials
               MgUserInformation userInfo = new
MgUserInformation(sessionId);

               //connect to the site and get a feature service and a
resource service instances
               MgSiteConnection site = new MgSiteConnection();
               site.Open(userInfo);
           
               MgFeatureService featService =
site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
               MgResourceService resService =
site.CreateService(MgServiceType.ResourceService) as MgResourceService;

          

               //Create a temporary map runtime object
               MgMap map = new MgMap();
               map.Open(resService, mapName); //fails in this line

               //get layers of the map
               MgLayerCollection layers = map.GetLayers();
               //layers count
               int layerCount = layers.GetCount();

               //first clear befor loading items
               ddlLayer.Items.Clear();

               for (int i = 0; i < layerCount; i++)
               {
                   //add layer names to the layers drop down
                   ddlLayer.Items.Add(layers[i].GetName());
               }

This code works ok for all the maps where there is no restriction on the
user group accessing the mapdefinition. But gives a resource not found (map
definition resource) error for maps which have access permissions set for a
particular group. When the web layout prompts for username and password, I
give the administrator user name and password which has access rights to the
particular map definition, but still I get a resource not found error. What
am I missing in the code? Please help me to sort this. 

Thanks all.
poy



-- 
View this message in context: http://www.nabble.com/please-clarify-user-authentication-issues-tp19392680p19392680.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list