WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => General Help & Support => Topic started by: crnogorac081 on February 26, 2025, 10:16:17 AM

Title: 2.13.6. permissions
Post by: crnogorac081 on February 26, 2025, 10:16:17 AM
Hello,

I noticed some new permissions: admin, admin_basic, admin_advanced

I couldnt find out where are they used, does anyone know ? Is there an intention to use this for ajax requests (my intention to use it for this)?
Title: Re: 2.13.6. permissions
Post by: sternchen8875 on February 26, 2025, 10:48:47 AM
Dietmar's last secret.....

these 3 permissions are not in use yet. i remember, that it was planned, to build a new permission handling, but no details
Title: Re: 2.13.6. permissions
Post by: crnogorac081 on March 06, 2025, 12:54:05 PM
another "dumb" question, if page is in root, parent = 0, what is root parent ?


If page_id = 123 , parent = 0, root_parent = 0 or is it 123 ? Because i see cases in phpmyadmin where for one page both root_parent and parent are 0, and other page is parent = 0, root_parent is its own page_id.

What is the correct way ?
Title: Re: 2.13.6. permissions
Post by: sternchen8875 on March 06, 2025, 01:03:27 PM
Quote
If page_id = 123 , parent = 0, root_parent = 0 or is it 123 ? Because i see cases in phpmyadmin where for one page both root_parent and parent are 0, and other page is parent = 0, root_parent is its own page_id.

in level == 0, root_parent is == page_id from this page, if its has own page_content.
pages with page_type == menu-link has the root_parent == 0, because, it has no content, only a redirect
Title: Re: 2.13.6. permissions
Post by: crnogorac081 on March 06, 2025, 01:50:22 PM
tnx, I thought its a bug, because I see there is content - look at the seccond page from top.

(https://i.ibb.co/zWRpLG41/Snimak-ekrana-2025-03-06-135321.jpg) (https://ibb.co/ds2F3G5S)

could it be that page is created as menu_link, then deleted menu_link and replaced with wysiwyg...

What is this page_root used for ?
Title: Re: 2.13.6. permissions
Post by: sternchen8875 on March 06, 2025, 03:30:46 PM
A root_parent is primarily used to create the page and menu structure. It is always the topmost element in the root for the respective branch at level == 0

The technical part then becomes somewhat confusing
The database field root_parent has a default value of 0
If a page is created, this field is not used and remains (briefly) at zero. Subsequently, the root_parent is determined using the parent of the new page transmitted in the form. This is done by MySQL queries of level and parent.
- If the level of the parent == 0, the Root_Parent of the new page is its page ID.
- If the level == 1, the Root_Parent == is the parent of the new page.
- If the level is not 0, the search continues via the pageTrail until the parent == 0.
- If no result is obtained, the Root_Parent remains at 0

Quote
pages with page_type == menu-link has the root_parent == 0, because, it has no content, only a redirect

forget this, it was not correct   :oops:

Quote
could it be that page is created as menu_link, then deleted menu_link and replaced with wysiwyg...
If we assume normal practice, a page with a menu link section cannot have any other sections, but it would of course be possible to create a new page with a different section type and move the child page of the menu link to this new page. This happens to me quite often because I often forget to select the menu link

Quote
I thought its a bug, because I see there is content - look at the seccond page from top.

i cannot say: NO, THERE IS NO BUG
Within the WB page overview there is the SectionList here

(https://i.gyazo.com/5fdb5f4418497090567f940c00230284.png)

This icon is deactivated in the overview for menu links. I would look here in the database, especially with the page ID in the sections table. If a page has a section == Menu-Link, no further sections may exist, Menu-Link is a pure redirection via header(Location), a further text output by another section would lead to a fatal error


Title: Re: 2.13.6. permissions
Post by: crnogorac081 on March 07, 2025, 09:59:14 AM
So if I understood this correctly root parent is always a page ID number, with an exception if page is only many link section, the root patent Is 0
Title: Re: 2.13.6. permissions
Post by: sternchen8875 on March 08, 2025, 12:09:36 AM
Quote
with an exception if page is only many link section, the root patent Is 0

no, see my last answer, this was wrong, sorry.

The conditions once again
- If the level of the parent == 0, the Root_Parent of the new page is its page ID.
- If the level == 1, the Root_Parent == is the parent of the new page.
- If the level is not 0, the search continues via the pageTrail until the parent == 0.
- If no result is obtained, the Root_Parent remains at 0

The last two options are checked when editing the page properties and set to 0 if parent and level are also zero
The root_parent is required when creating menus, especially for menus in multilingual pages, to determine the starting point of a language branch