Expand Minimize

SMA256401: WebParts that use the UserProfileManager

SharePoint 2013 gives access to a new set of user profile based methods, and properties which can be used to accomplish almost all tasks existing webparts could use.

CheckId SMA256401
TypeName WebPartUserProfilesManager
Severity CriticalWarning
Type Assembly

Full Trust Approach App Approach
User Profile Manager

The Use Profile Manager (UPM) is used to allow you to edit user profiles and manage users at a farm level.

SP.UserProfiles

User Profile Manager is replaced with SP.UserProfiles in the App Model and is accessible with the correct permissions.

Impact of Full Trust Approach Benefit of App Approach
UPM User Rights

Users require access to the UPM and in some cases it is done with elevated privileges, which is a security risk.

Pre authorise permissions

The correct approach is to only let users do what they have permissions to do.

Comprehensive API

The UserProfile API is comprehensive, covering all the required tasks that you may need when modifying or setting up users.

Efforts and Benefits

Migration Impact High
Re-Design Effort Medium
Re-Development Effort Medium ~ High
Long Term Benefit Medium

Effort Drivers

  • Enforces security standards in development practices
  • Full migratable

To suppress this violation in managed code add the following attribute to the method which contains the instruction (available since SPCAF version v5.2). Learn more about SuppressMessage here.

// Important: Ensure to have #define CODE_ANALYSIS at the beginning of your .cs file
[SuppressMessage("SPCAF.Rules.MigrationAssessment.CollaborationCustomizationsGroup", "SMA256401:WebPartUserProfilesManager", Justification = "Provide reason for suppression here")]
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.