Admin View Permissions & Child Pages Site Map

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
11/5/2011 11:03:43 AM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

Hi,

To be honest I don't know why it has this kind of thing for selection logic:

  || ((isSiteEditor) && (siteSettings.SiteRootEditRoles.LastIndexOf(listItem.Value + ";") > -1))

I probably had some reason for doing that at some point but it seems incorrect today. I've commented that part out and committed to the repository. I also fixed a bug in the parent page dialog which was not showing any pages for site editors in child sites.

I've got a family event the rest of the day but tomorrow I will do some thorough testing on the scenario of related sites mode and child site editors and look for any other things that are not working as expected. I admit I'm not using related sites mode in any of my own sites so it has not been something I've been testing frequently and is overdue for some review.

Q2: Since all of our roles were defined in the root site before a child side was created, the list of roles to choose as Site Editor are the default ones.  SiteSettings.aspx.cs uses selectedSite to get a list of roles to display.  I think it would make sense to check if UseRelatedSiteMode is enabled and display roles from the site specified by the RelatedSiteID key maybe?

Roles are consistently used in all cases in related sites mode as far as I know because with related sites mode enabled the Role.GetSiteRoles method is using the related site id no matter what site id is passed in.

public static IDataReader GetSiteRoles(int siteId)
{
        if (UseRelatedSiteMode) { siteId = RelatedSiteID; }

        return DBRoles.GetSiteRoles(siteId);
}

Best,

Joe

11/7/2011 11:13:10 AM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

I found and fixed a few items related to site editors over the weekend. Site Editors in related sites mode should be essentially like being Content Administrator but limited to the specific site whereas Content Administrators would have edit permissions in all sites in related sites mode. I went through and compared with 2 browsers one as Content Administrator and one as Site Editor and fixed some inconsistencies in what menus and abilities were available to site editors.

I tested also the "Roles Not allowed to edit feature instance settings" and it seems to work correctly for me. I didn't get a chance to see what you had setup on the demo site, it has been reset. That setting is not meant to take away powers from Administrators or Content Administrators so setting those roles there would not have any effect, just the same as those roles do not need to be checked to allow editing by Administrators or Content Administrators. I should probably filter those roles out for that setting, I'll look into doing that.

Best,

Joe

11/9/2011 11:36:03 AM
Gravatar
Total Posts 156

Re: Admin View Permissions & Child Pages Site Map

Your latest definition of a "Site Editor" is a bit different from what's in the help file which indicates that "Site Editors" have the rights of "Administrators," but limited to a particular site instead of all sites  when "UseRelatedSiteMode" is enabled:

When using Related Sites Mode, all sites in an installation use the same set of users and roles. Therefore a user in the administrators role is an administrator of all sites. Site Editor roles allow you to specify roles that can edit a single site within a multi site installation using related sites mode without making the user an administrator in all sites. Users in these roles will effectively have administrative permissions in a single site whereas if you add them to the administrators role they would have admin permissions in all sites.

Also enforceRelatedSitesMode property in mojoPortal.Business\Role.cs seems redundant to me as you already have UseRelatedSiteMode property that you are checking; the following lines could be adjusted:

Web\Admin\RoleManager.aspx.cs(116):                role.EnforceRelatedSitesMode = WebConfigSettings.UseRelatedSiteMode;
  mojoPortal.Business\Role.cs(57):        private bool enforceRelatedSitesMode = false;
  mojoPortal.Business\Role.cs(143):        public bool EnforceRelatedSitesMode
  mojoPortal.Business\Role.cs(145):            get { return enforceRelatedSitesMode; }
  mojoPortal.Business\Role.cs(146):            set { enforceRelatedSitesMode = value; }
  mojoPortal.Business\Role.cs(209):            if (UseRelatedSiteMode && enforceRelatedSitesMode) { siteID = RelatedSiteID; }
  mojoPortal.Business\Role.cs(327):        //    bool enforceRelatedSitesMode = false;
  mojoPortal.Business\Role.cs(328):        //    return GetbySite(siteId, enforceRelatedSitesMode);
  mojoPortal.Business\Role.cs(331):        public static Collection<Role> GetbySite(int siteId, bool enforceRelatedSitesMode)
  mojoPortal.Business\Role.cs(333):            if (UseRelatedSiteMode && enforceRelatedSitesMode) { siteId = RelatedSiteID; }

11/9/2011 11:52:47 AM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

You are right about the help file, but I have updated that in the latest source code to say Site Editor is like Content Administrator except limited to a specific site. My reasoning is because in related sites mode all users and roles come from the master site so it doesn't make sense for site editors in related sites mode to be able to manage users unless specifically given permissions through the other available mechanisms, ie roles that can manage users.

I agree some of those checks/properties are redundant, I will clean that up.

Best,

Joe

11/9/2011 12:21:23 PM
Gravatar
Total Posts 156

Re: Admin View Permissions & Child Pages Site Map

How do you prefer to deal with code changes?  Would a mercurial generated  (hg diff) patch be preferable or Codeplex fork w/ pull requests would work better?

I don't know that code changes are necessarily worthy of a forum post... unless it is a behavioral/logical bug that needs to be mentioned/discussed first.

11/9/2011 12:30:51 PM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

I've already cleaned that up and pushed it to the repository.

In general I prefer people to zip up modified files and send them to me with their changes marked by comments to make them easy to find. I like to review the changes and apply them myself rather than just applying patches.

Best,

Joe

11/9/2011 12:41:43 PM
Gravatar
Total Posts 156

Re: Admin View Permissions & Child Pages Site Map

That setting is not meant to take away powers from Administrators or Content Administrators so setting those roles there would not have any effect, just the same as those roles do not need to be checked to allow editing by Administrators or Content Administrators. I should probably filter those roles out for that setting, I'll look into doing that.

Personally, I think having "Administrators" role showing up under all settings is a bit misleading as they [Administrators] can do anything regardless of whether the checkbox next to them is checked or not.  I would take it out everywhere and instead select "Content Administrators" for every newly created page/module by default.  In cases where a non-root page is being created, it will simply inherit from the parent as it does now.

The admin only corner cases would apply when all of the checkbox are unchecked under any given setting. 

Doing this will make it clear to anybody that "Administrators" are godlike and you don't even need to bother messing with the checkboxes next to them.

Thoughts?

 

11/9/2011 12:46:24 PM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

I've already filtered the roles in permissions tab in site settings in the latest code both for Administrators and Content Administrators who can do anything without explicitly granting their roles permissions. But not in other places like page settings because it is needed there for the case where you want to limit something to only administrators.

Best,

Joe

11/9/2011 1:02:36 PM
Gravatar
Total Posts 156

Re: Admin View Permissions & Child Pages Site Map

But not in other places like page settings because it is needed there for the case where you want to limit something to only administrators.

That is exactly the point I was trying to make.  You would just have all of the checkbox unchecked in which case it would automatically be "Administrators" only.  See what I'm saying?

11/9/2011 1:18:58 PM
Gravatar
Total Posts 18439

Re: Admin View Permissions & Child Pages Site Map

I see what you are saying but that would require a lot of changes because if we add logic to set the roles to only admins when nothing else is checked, then Content Administrators would need to always be checked in order for content admins to have access whereas currently Content Admins can edit anything without having their role explicitly checked as allowed.

I don't think I want to make that change at this time because the scenario of locking down a page to only admins is an edge case or at least a less common case. I want people to have to do something on purpose to lock out content admins ie checking only Administrators, I don't want it to happen accidently because they unchecked all the roles.

Best,

Joe

11/9/2011 3:13:58 PM
Gravatar
Total Posts 156

Re: Admin View Permissions & Child Pages Site Map

I see what you are saying but that would require a lot of changes because if we add logic to set the roles to only admins when nothing else is checked, then Content Administrators would need to always be checked in order for content admins to have access whereas currently Content Admins can edit anything without having their role explicitly checked as allowed.

It sounds like "would require a lot of changes" is the primary reason and I would certainly be more than willing to submit a patch. I understand that having put in place WebUser.IsAdminOrContentAdmin  or '== "Admins;")' all over the source makes it a bit cumbersome to modify, but it would simplify the UI and that's all that matters at the end of the day.

You could have a couple queries in the update script to modify the database to reflect the way new UI works by checking which EditRoles are null or empty and setting those "Admins; Content Administrators;".  Your last point will be addressed since the update script will convert all null/empty  view/edit roles to  "Admins;Content Administrators;" and if the user DID want an Admin only scenario, they would have to uncheck "Content Administrators" or whatever other roles they had checked, so it would require them to perform an action and would not happen accidently. 

Speaking of accidently, the reason we ran into Admin only scenario was because those "Administrators" checkboxes were being checked by default due to the logic in PageSettings.aspx.cs and thus every time "Content Administrator" modified page settings, they would automatically lock themselves out of the page by creating an Admin Only scenario since the "Content Administrators" checkbox was not checked either.

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