0

I am getting an access denied exception while executing SPSite.Usage.Storage with Contribute access, even though I have used run with elevated privileges. It works okay when I run it with site owner permissions.

2 Answers 2

1

Contribute level permission is not sufficient to get the details you are looking for. Contribute permission basically entails (as per MSDN) - "Enables users to manage personal views, edit items and user information, delete versions in existing lists and document libraries, and add, remove, and update personal Web Parts"

You need to have a minimum of "Manage" permissions. Better upgrade your permission levels to either of these and then try again -

  • Full Control
  • Design

More about permissions can be found here

1
  • But I am also using run with elewated privilage, and in this case code should run with app pool account and app pool has full control, still it is giving thea same exception.
    – notorious
    Commented Jan 16, 2018 at 4:48
0

Try to assign Auditor permission to the user (including application pool account).

Central administration -> Manage web applications -> Select the web application -> User policy

1
  • App pool account already has Full control
    – notorious
    Commented Jan 16, 2018 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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