Overwriting member access restrictions (group access) down the tree? Options
teasy
Posted: Wednesday, November 08, 2006 1:13:55 AM
Rank: Newbie

Joined: 11/8/2006
Posts: 5
I just wondered if this is by design, a bug or maybe i missed something... Just tried to protect a page with access to member groups "a" and "b". Later down the tree i tried to remove "b" so anyone in group "a" and "b" can access the top pages but some documents down the tree are only accessible for "a".

Removing group "b" first seemed to work but "a" and "b" still have access. The topmost access restriction seems to be valid for all lower level trees without a chance to do a break in there.

Anyone with an idea?

Many thanks,
Marcus
teasy
Posted: Wednesday, November 08, 2006 1:23:03 AM
Rank: Newbie

Joined: 11/8/2006
Posts: 5
Just for a better understanding, what I tried to accomblish is: User A = Member of Group a+b, User B = Member of Group a. User A should get access to /protected-pages/secret but User B is only allowed to access /protected-pages. My problem is that protecting /proteced-pages for Group A+B also protects /protected-pages/secret with these groups and I found no way to remove Group B from /protected-pages/secret.

Thanks for your ideas,
Marcus
drobar
Posted: Wednesday, November 08, 2006 3:17:00 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Marcus, thanks for asking this question. I have seen the same thing (version 2.1.4). Curiously, if you remove protection from the topmost level you will get the protection you wanted at the next-lower level. So Umbraco *is* maintaining the protection information properly for each node but there must be a bug that it doesn't check for it properly, simply using the protections of the top-most node with protection.

Like you, I want a commonly protected area (client login, in my case) that has information appropriate to all clients (but not to general visitors). Within the client area I also want a page (or pages) for individual clients that have information unique to that client.

I got this far in the "debugging" process and got sidetracked with other issues and haven't gotten back to this, but I need it to work. Please keep us posted with what you find out!

cheers,
doug.

MVP 2007-2009 - Percipient Studios
teasy
Posted: Wednesday, November 08, 2006 12:30:39 PM
Rank: Newbie

Joined: 11/8/2006
Posts: 5
Douglas Robar wrote:

Curiously, if you remove protection from the topmost level you will get the protection you wanted at the next-lower level. So Umbraco *is* maintaining the protection information properly for each node


Yes, looks like some query got messes up at this point. So far I had no time to take a deeper look at the umbraco source and my VS2003 web dev environment is totaly messed up anyway (I always hoped i can wait until v3 for VS2005 is ready) but as I need this feature working I will take a look at the code.

I'll come back with my findings as soon as i got time looking at the code. I would be glad if someone has an idea on where to start searching within the code tree (2.1.4) so I can start without the VS2003 working for debuging... Thanks, Marcus.
teasy
Posted: Wednesday, November 08, 2006 5:46:41 PM
Rank: Newbie

Joined: 11/8/2006
Posts: 5
doug, I guess the problem is in cms\businesslogic\web\Access.cs, method getProtectedPage().

I can't verify this as I am absolutly new to the umbraco source and my VS2003 is messed up so maybe someone that is more in the code can verify this:

All access configuration is stored in access.xml. The code below walk trough a list of page id's and I assume these are the id's for the requested path in path order. In case this is true, the code would return the first match and not the "best match" as it shoudl be (see the break in the foreach loop).

Am I right with this?
Code:

private static int getProtectedPage(string Path)
        {
            int protectedPage = 0;

            foreach(string id in Path.Split(",".ToCharArray()))
            {
                if (getPage(int.Parse(id)) != null)
                {
                    protectedPage = int.Parse(id);
                    break;
                }
            }
            return protectedPage;
        }

        private static XmlNode getPage(int documentId)
        {
            XmlNode x = AccessXml.SelectSingleNode("/access/page [@id=" + documentId.ToString() + "]");
            return x;
        }


An access.xml looks like:
Code:

<access>
  <page id="1113" loginPage="1053" noRightsPage="1054" simple="False">
    <group id="1081" />
  </page>
  <page id="1244" loginPage="1243" noRightsPage="1243" simple="False">
    <group id="1250" />
    <group id="1251" />
  </page>
  <page id="1247" loginPage="1243" noRightsPage="1243" simple="False">
    <group id="1081" />
  </page>
</access>


Cheers,
Marcus
teasy
Posted: Wednesday, November 08, 2006 6:00:05 PM
Rank: Newbie

Joined: 11/8/2006
Posts: 5
YEEES, that's it! Just remove the break; in the foreach and anything works as intended!

Where do patches go to, the SVN is ro so where to send this?

Marcus
astuanax
Posted: Wednesday, April 18, 2007 10:27:08 AM

Rank: Devotee

Joined: 7/20/2006
Posts: 89
Hi Marcus,

I am having the same problem, using 2.1.6, did you get this in the soruce code?
If not could you help me out?

Thx, Len.
astuanax
Posted: Wednesday, April 18, 2007 4:26:57 PM

Rank: Devotee

Joined: 7/20/2006
Posts: 89
I applied the fixed mentioned above, it really works, should put it on the svn code.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.