+ Start a Discussion

Access to entity 'StaticResource' denied



    I have posted my issue here..



can someone please help??


Have also pasted the same below for quick access.. but not formatted properly as i have copied and pasted from stackexchange. sorry for that..

Access to entity 'StaticResource' denied. How to give access to partner portal profile? :-





calling an actionfunction reloads the page despite giving 1.return false from the place where we call 2. rerender="emptydiv" and says insufficient privileges in Sites (authenticated using partner portal).. but if we refresh the page again or reload by pressing enter in the url again, its not throwing that insufficient privileges error..

any ideas or suggestions to solve this problem would be much appreciated...

updated :- I have given access to all the objects and classes. when I try to preview as admin, I got this error. "Access to entity 'StaticResource' denied" Am accessing this in my code. Not sure how to give access to this StaticResource Object for my Partner Portal User Profile.I dont find this object in the profile. Can you please help?

List resourceList = [SELECT Name, NamespacePrefix, SystemModStamp FROM StaticResource WHERE Name = 'MyStyles'];

This is my scenario :- I have a JQGrid. inside that I have a column in which I have a link (a tag).
Am populating data for the JQGrid from from the controller.
The method is hit as I have specified the URL parameter of JQGrid.

So whenever the pageload or any operation in the grid happens and tries to reload the grid, it hits the url and based on the JSON returned, the grid is populated.

Inside the grid, I have to show some images. for doing that am getting the images through the above code and assigning it to a property for displaying in the grid. The GetresourceURL function in the below code pulls the data from the list fetched in above code and checks what type of image is needed and does some manipulations and gives the actual resource url for the image.

I have just pasted the smaller version of the GetResourceURL code for your easy understanding.

Actually the thing here is, when i click on the application link it should log an entry in a tracking object (just to note that the user has clicked the link and its used for reporting purposes later). for this reason am doing an onclick javascript and from this am calling an actionfunction which does the job of logging in to necessary object and opens the target link in a new tab.

actually it logs the data and it tries to reload the page. not sure why it does that.. the same page is not reloaded.

if i run the visualforce page as a system administrator, but when viewing from sites url as an external customer this "Insufficient privileges" error is thrown.

So, first time the page is getting loaded. When i click on this link the page is performing actionfunction when viewed from sites, and reloading the page (which shouldnt actually reload). If it is an insufficient access for static resource how is it able to access for the first time load? 

asset.ApplicationNumber = (currentAsset.Country_c == 'US' && currentAsset.URL_c != null && !currentAsset.URL_c.contains('patentnumber'))?string.format('{1}',new String[] {currentAsset.URL_c, currentAsset.ApplicationNumber_c,'\''+currentAsset.ApplicationNumber_c+'\'','\''+currentAsset.URL_c+'\'','\'' + currentAsset.Id +'\'','\'' + CompanyID +'\''}):currentAsset.ApplicationNumber_c;

currentDoc.DocumentTitle_c= string.format('{3}',new String[] {'\'' + currentDoc.Id + '\'','\'View\'','\''+UserType+'\'', (GetResourceURL(resourceList, currentDoc.FileType)!='')?(' '+ currentDoc.DocumentTitle_c):currentDoc.DocumentTitle_c,'\'' + docInfo.DocTitleWithoutImage +'\'','\'' + CompanyID +'\'','\'' + currentDoc.FileName_c +'\'','\'' + BaseURL +'\''});



return ((Site.getPrefix() != null) ? Site.getCurrentSiteUrl() : '') + '/resource/' + resourceLst[0].SystemModStamp.getTime() + '/' + (namespace != null && namespace != '' ? namespace + '__' : '') + 'MyStyles' + '/CSS/Images/' + imageName;


When I use chrome developer tools to see whats happening. I am seeing an internal server error 500 :-
This error is thrown :-

this._request.send(this._query.getQueryString());if(this._timeout>0){this._timeoutID=window.setTimeout(function(){LOG.warn("request stopped due to timeout");if(!_this._aborted){if(typeof(A4J.AJAX.onAbort)=="function"){A4J.AJAX.onAbort(_this);}}

Images below :- (says I dont have 10 reputation and not allowing me to post images. but it gave this url. when i uploaded. please check if you are able to see this image or else let me know i will post it somewhere else and will give the url.)