Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

RevertTo... admin... please?

  Asked By: Coty    Date: Nov 24    Category: Sharepoint    Views: 730

"I've gotta be me".... and strangely enough, that's a problem.
I have a list on an anonymous "common resources" site that I need to
prevent users from item browsing, but my web part must access the
items as configuration info.

I've setup the app pool to run as a local admin, and the simple
RevertToSelf() call isn't helping, nor do I think simple
Impersonation would help. Looking around the 'net I've found that
certain points in the SharePoint OM ignore the
RevertToSelf/Impersonation functionality. For instance, the
Web.CurrentUser.Roles only looks at the user from the request. I
believe that SPList.Items also mandates the user from the request
have access.

In Prather's article link below, he suggests doing the work in a new
appdomain to avoid the request's context, but I've had problems
tweaking his example. At this pointI'm stuck at:
Access Denied System.Runtime.InteropServices.COMException
(0x80004005): Cannot complete this action. Please try again. at
Microsoft.SharePoint.Library.SPRequestInternalClass.OpenWeb(...
on this line:
using (SPWeb web = site.OpenWeb (webID))

Prather's article:
www.bluedoglimited.com/.../viewpost.asp
x?ID=7

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Nathanial Mcclure     Answered On: Nov 24

You should be able to mark the list  as hidden and then it will not display through the IE GUI, but will be available through FrontPage and your web  parts. This way you can still run  as the user  and don't have to worry about any special personalization code.

 
Answer #2    Answered By: Matt Prince     Answered On: Nov 24

How would you mark a list  as Hidden?

 
Answer #3    Answered By: Brooks Bond     Answered On: Nov 24

Actually, I may need to do this or the appDomain technique
later, but for now, I am probably going to bite the bullet and put
my configuration  info into xml files on the filesys rather than use
lists of an anonymous  site. Oh well.

 
Answer #4    Answered By: Gregg Wilkinson     Answered On: Nov 24

You can do it through Code or FrontPage..

In FrontPage - Open the site  that contains the list, Right click on the list  and select Properties, Chose the Settings tab and you will see an option to make the list hidden from browsers.. You can toggle this on and off anytime, so to edit the list you would make it visible, make your changes, and then turn it back off.

You should also be able to link  the list to a spreadsheet and save the sheet for future use. Then you can hide the list, but still make your edits through the spreadsheet. (untested, but in theory it would work) This option is GREAT for look-up lists!

 
Answer #5    Answered By: Darrel Sexton     Answered On: Nov 24

I've used both of these options in the past and they work  great! Highly
recommended.

 
Answer #6    Answered By: Tory Sellers     Answered On: Nov 24

When using impersonation for an Anonymous User there are parts of the
Object Model that do not work. Microsoft does not intend to fix this bug
(this knowledge base article  is the result of my work  with PSS on this
issue: http://support.microsoft.com/?kbid=892866).

You must change the security context. There are two ways to accomplish
this. I currently use the AppDomain approach but it has its drawbacks
(nothing you get back from SharePoint's Object Model is serializable and
everything that was available in the Web's context  that is needed in the
AppDomain must be passed as parameters).

The other approach is to use a Web Service. I didn't do it that way so I
can't give you the specific pit falls. But all the normal things about
Web Services apply.

 
Didn't find what you were looking for? Find more on RevertTo... admin... please? Or get search suggestion and latest updates.




Tagged: