SharePointFBAPack
SharePointFBAPack copied to clipboard
Change Password Pages does not work with restricted access
When you give an FBA user only rights to certain lists, libraries, folders or listitems. SharePoint automatically gives 'Restricted Access' role for the user on Web/Site-Level. The user with such rights will see the "Change Password" menu item but when he clicks it, it will show access denied.
This is because ChangePassword.aspx.cs code is simply subclassed LayoutsPageBase:
public partial class ChangePassword : LayoutsPageBase
{
}
with the default rights being:
public static readonly SPBasePermissions DefaultLayoutsRights = SPBasePermissions.ViewFormPages | SPBasePermissions.Open | SPBasePermissions.ViewPages;
protected virtual SPBasePermissions RightsRequired
{
get
{
return LayoutsPageBase.DefaultLayoutsRights;
}
}
adding this to the ChangePassword class:
protected override SPBasePermissions RightsRequired
{
get
{
return SPBasePermissions.ViewFormPages | SPBasePermissions.Open;
}
}
should solve the issue (untested).
Thank you!
Tested it meanwhile, it required another boolean to override and set to false, now it works properly with restricted access rights.
public partial class ChangePassword : LayoutsPageBase
{
protected override bool RequireDefaultLayoutsRights
{
get
{
return false;
}
}
protected override SPBasePermissions RightsRequired
{
get
{
return SPBasePermissions.ViewFormPages | SPBasePermissions.Open;
}
}
}