none
UserPermission - General Unhandled Exception RRS feed

  • Question

  • I am getting the Error in the Following Code :

     res_global_ds = Res.ReadResourceAuthorization(ResId);
            Console.WriteLine("Before: ");
            WriteTablesToConsole(res_global_ds.Tables);
            
            foreach (WbSvcResource.ResourceAuthorizationDataSet.GlobalPermissionsRow scr1 in res_global_ds.GlobalPermissions)
            {
              if (scr1.RES_UID == ResId && scr1.WSEC_FEA_ACT_UID == PSLibrary.PSSecurityGlobalPermission.SaveUnprotectedBaseline)
              {
                Console.WriteLine(scr1.RES_UID.ToString() + "<>"+ scr1.WSEC_FEA_ACT_UID.ToString());
                Console.WriteLine("Resource row deleted from the global permission....");
                scr1.Delete();
                break;
              }
            }
            Console.WriteLine("Now Update the Resource Globally for the Saveunprotected Baseline");
            Console.ReadKey();
            
            WbSvcResource.ResourceAuthorizationDataSet.GlobalPermissionsRow r2 = res_global_ds.GlobalPermissions.NewGlobalPermissionsRow();
            r2.RES_UID = ResId;
            r2.WSEC_ALLOW = true;
            r2.WSEC_DENY = false;
            r2.WSEC_FEA_ACT_UID = PSLibrary.PSSecurityGlobalPermission.SaveUnprotectedBaseline;
            res_global_ds.GlobalPermissions.AddGlobalPermissionsRow(r2);        
    
            Res.SetResourceAuthorization(res_global_ds);        
            Console.WriteLine("Resource Update Globally....");
    

    any idea on this..!!?


    Thanks, Parth
    Thursday, July 21, 2011 1:43 PM

All replies

  • Can anyone please...!!?
    Thanks, Parth
    Friday, July 22, 2011 5:29 AM
  • Parth,

    What excatly you are trying to do? I see that you are trying to do update the resource by setting some global permissions? Am I understanding corretly?


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Friday, July 22, 2011 5:35 AM
  • Yeap, Exactly...
    Thanks, Parth
    Friday, July 22, 2011 5:43 AM
  • Did you try to debug & see where exactly is throwing the General Unhandled Exception. I couldn't check as I dont have VS2010 on my new machine. I might get that asap but while in mean time, Just try to see if the alternative approach below.

    Its a better process to not to modify the permissions at the resource level, Instead you can modify the category which is associated with a group where resource is falling. lets say you get a Resource A who is in PM Group from PSI & find the security category for the resource & in the category you set the enums for the permisssions.
    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Friday, July 22, 2011 9:33 AM
  • I can very well do that but unfortunately i have been told to do this... :) 

    and also SaveUnprotectedBaseline does not belong to any category out of the Box it is at the Resource level



    Thanks, Parth
    Friday, July 22, 2011 10:56 AM