Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'd like to create a library that my webpart uses to store documents. I would prefer to have this library only be visible through my webpart and by admins. Is this possible?

If so, how would I go about creating my library when the webpart is installed?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

By "installed" I presume you mean when the feature containing the web part is activated. In this case you can do this programmatically through the feature receiver, or declaratively. This subject is documented extensively elsewhere.

You can set permissions on the list to limit who can see it. In your web part you can use elevated priviledges to access the list, for example using the SPSecurity.RunWithElevatedPrivileges method.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.