Permissions reset to default on New Feature Installation

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
1/27/2012 6:25:14 AM
Gravatar
Total Posts 38

Permissions reset to default on New Feature Installation

When I install a new feature to a secondary site in a multi-site installation (with custom roles), the permissions are reset to default values.  Is there a way to avoid this/ a setting I'm missing?   The current behavior is not desirable, as I have to consult a document to put back in the custom security settings that I have assigned to the various roles (e.g. "Roles which can NOT edit feature settings"), each time that I add a new feature.

Breakdown of actions showing this behavior:

  • In Site 1 register new module in Advanced Tools / Features...
  • In Site 1 Administration I add new module to Site2 Features.
  • Opening Site 2 I find all Permissions to be reset under Site Settings / Security / Permissions

The behavior is observed on versions 2.3.6.7 as well as the newer 2.3.7.6.

1/27/2012 6:33:19 AM
Gravatar
Total Posts 18439

Re: Permissions reset to default on New Feature Installation

yes, that is how it works, sites are independent, permissions are not inherited

1/27/2012 6:59:58 AM
Gravatar
Total Posts 38

Re: Permissions reset to default on New Feature Installation

 

My entire site security settings are erased when I install a new feature.  

 

I'm not referring to the security settings of the feature, which are independent.  The security settings that are being reset are the SITE SECURITY SETTINGS (e.g. Roles that can browse and upload files).  These have nothing to do with the feature that is being installed.  

I'm not expecting anything to be inherited.  I'm expecting my site security settings to be left alone by the administration site when adding the new feature to the secondary site.  Instead it appears to be overwriting them.

1/27/2012 7:37:59 AM
Gravatar
Total Posts 18439

Re: Permissions reset to default on New Feature Installation

Sorry but I cannot reproduce the problem you describe using mojoPortal 2.3.7.6, I don't have a version of 2.3.6.7 installed but I really don't see how it could possibly do what you are saying unless you've made your own build and changed the code.

I would be very surprised if that bug really existed in my releases and no-one reported it until now.

My advice is upgrade to 2.3.8.1 where site permissions have been moved out of site settings page into a separate set of pages.

1/27/2012 10:31:06 AM
Gravatar
Total Posts 18439

Re: Permissions reset to default on New Feature Installation

Just thought of one thing that could cause the problem you describe and that is if you added a <form> element anywhere in your skin or content. A similar thing happened on this thread, and it caused me to lose some site settings on my local machine when I saved site settings using the skin that had the extra from in it because asp.net interpeted its closing tag as the end of the main form. In asp.net webforms there can be one and only one form element and it already exists so you cannot add any.

Hope that helps,

Joe

1/27/2012 12:08:15 PM
Gravatar
Total Posts 38

Re: Permissions reset to default on New Feature Installation

Thanks for the suggestions, which I've had a look at;   No form elements in layout.master or in my webusercontrols.  

A few more observations though.  If I set custom permissions on site 2 (eg, roles that are allowed to create users), then go into the master site (1) to edit site settings 

like this:  http://127.0.0.1/Admin/SiteSettings.aspx?SiteID=2


as if to install a new feature, or whatever, and check the permissions tab there (for site 2), none of  the the permissions defined in site 2 are loaded.  Instead, what you get are  the default permissions for roles.

Wandering through the code called on the click event of the mojobutton "Save" (and I haven't traced this all the way to the data layer yet)  I see that the erroneous roles are bound to the selectedSite object in preparation for saving.

selectedSite.RolesThatCanCreateRootPages = chkRolesThatCanCreateRootPages.Items.SelectedItemsToSemiColonSeparatedString();

...


selectedSite.RolesNotAllowedToEditModuleSettings = chkRolesNotAllowedToEditModuleSettings.Items.SelectedItemsToSemiColonSeparatedString();
selectedSite.RolesThatCanCreateUsers = chkRolesThatCanCreateUsers.Items.SelectedItemsToSemiColonSeparatedString();
selectedSite.RolesThatCanManageUsers = chkRolesThatCanManageUsers.Items.SelectedItemsToSemiColonSeparatedString();
selectedSite.RolesThatCanLookupUsers = chkRolesThatCanLookupUsers.Items.SelectedItemsToSemiColonSeparatedString();
selectedSite.RolesThatCanViewMemberList = chkRolesThatCanViewMemberList.Items.SelectedItemsToSemiColonSeparatedString();

I haven't followed this through completely, but it looks to me as if default permissions, not the selected site's permissions, are being bound to the selectedsite object.  When the page data are saved, these faulty permissions are also then saved to the data layer.  If so, the fault would be in binding the site's permissions correctly to the checkboxes on page load rather than anything going haywire on save.  

1/27/2012 12:27:05 PM
Gravatar
Total Posts 18439

Re: Permissions reset to default on New Feature Installation

You are just speculating

1. The btn to add or remove features to a site doesn't save site settings so it can't affect permissions

2. of course the btn for saving site settings does set the site permissions to the values from the checkbox lists, nothing erroneous about that

3. The role binding was called from PopulateControls which is not called on postback and there wasn't anything erroneous about it

4. All of that is moot because you are looking at old code, in the latest code the permissions are not in site settings

I have no explanation for what you are saying is happening but no-one else has reported it and I was not able to reproduce it and I don't think it was a mistake in the previous code, but as I said that stuff is no longer in the site settings page at all. My advice is to upgrade.

1/27/2012 1:17:28 PM
Gravatar
Total Posts 38

Re: Permissions reset to default on New Feature Installation

Ok.

1/27/2012 1:54:05 PM
Gravatar
Total Posts 18439

Re: Permissions reset to default on New Feature Installation

Only other thing I thought of is if you are using Related Sites Mode where all the sites share the same users and roles then those permissions related to managing users (ie Roles that can view memeber list, Roles that can create users, roles that can manage users, roles that can lookup users) will by design be propagated from the master site to the child sites and in previous versions (including 2.3.7.6) the other permissions (ie upload etc) were also propagated but not in the latest version. By propagated I mean when you save them in the master site they are applied also to the child sites in related sites mode. The latest version does still propogate the permissions related to managing users as it should since users are the same in all sites.

So maybe that is what you are seeing, you didn't mention whether you were using related sites mode, but if so that would explain it and you will find it works correctly in the latest version.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.