Allow developer to prevent deletion of specific pages in structure

0 views
Skip to first unread message

Alexander Obuhovich

unread,
Mar 29, 2010, 5:58:35 AM3/29/10
to In-Portal Development
There are some cases, when we have page on front-end with hardcoded link, even, when link is <inp2:m_Link template="id:12"/> with automatic path building to template. When user deletes this page, then link will be broken until he create new page with same id (which is impossible) or with same name (he never imagines, that he should do it to fix it's problem).

Today is strange approach to create template, that just includes "default_design". This way page becomes system and therefore can't be deleted from structure. I'm against such approach since it's not really understandable, when you look on that template with one include why it was created in first place.

I propose we create new field for categories/sections, that will indicate, that given page can't be deleted without specific advanced permission, which administrators don't have and maybe only super-root will have (or while in debug mode). Also we need to update such column for all system pages and in future use it nor page status (system or not) to determine if it can be deleted.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Mar 29, 2010, 6:42:04 AM3/29/10
to In-Portal Development
I can't really remember why we needed protection against system page deletion at all. When system page is deleted, then associated physical template is not deleted. Then user can use "Refresh" button in "Themes" section and our section, that we just deleted by accident will be back in no time.

At the end I see this like this:
  1. add new field "Protected" (Yes/No) on category editing page and maybe in grid, but hidden by default;
  2. remove inability to delete system pages;
  3. add new permission named "Delete Protected Sections" (and check it for "root" user too);
  4. maybe in debug mode virtually give that permission to any user in administrative console;
  5. when user tried to delete protected section without proper permissions show him nice alert or red message above the grid, that "Protected section were not deleted" or something like that.

S.G.

unread,
Mar 29, 2010, 9:58:26 AM3/29/10
to In-Portal Development Team
I think that such fields should be visible & deleting such categories
should be allowed in Debug Mode, not by permission. Site administrator
(who in most cases logs in as root) shouldn't be able to delete
protected content, but only developer.

Also, may be we need to think about System field in grid and how to
merge it with new Protected field functionality. For me, System field
currently doesn't make much sense, but with Protected field nobody
will understand what these two mean and what is difference between
them. May be, we need to rename something: System - to Is Theme File,
and Protected - to System. May be somebody has better ideas for
translations?

On Mar 29, 1:42 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> I can't really remember why we needed protection against system page
> deletion at all. When system page is deleted, then associated physical
> template is not deleted. Then user can use "Refresh" button in "Themes"
> section and our section, that we just deleted by accident will be back in no
> time.
>
> At the end I see this like this:
>

>    1. add new field "Protected" (Yes/No) on category editing page and maybe


>    in grid, but hidden by default;

>    2. remove inability to delete system pages;
>    3. add new permission named "Delete Protected Sections" (and check it for
>    "root" user too);
>    4. maybe in debug mode virtually give that permission to any user in
>    administrative console;
>    5. when user tried to delete protected section without proper permissions


>    show him nice alert or red message above the grid, that "Protected section
>    were not deleted" or something like that.
>

Phil ..:: domicilis.biz ::..

unread,
Mar 29, 2010, 10:23:03 AM3/29/10
to in-por...@googlegroups.com
By the way, is there a way to hide these "light red" system folder for admin (and root) users?
Root user could still activate this view, but standard admin wouldn't be able to do so.

For example, I have a customer who have many different theme files, and he don't understand why he have dozens of "_Auto: design/xxx" in his admin...

2010/3/29 Alexander Obuhovich <aik....@gmail.com>
To unsubscribe from this group, send email to in-portal-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Alexander Obuhovich

unread,
Mar 29, 2010, 3:23:05 PM3/29/10
to in-por...@googlegroups.com
He probably have theme not compatible with 5,x release (like onlinestore theme now). He should add ".smsignore" file in each directory for each theme with ".*" in it. Then delete all "_Auto: ..." pages. Then press "Refresh" on "Themes" section. If he did all correct, then no new sections with red icons will be created.

Phil -- wbtc.fr --

unread,
Mar 29, 2010, 4:25:34 PM3/29/10
to in-por...@googlegroups.com
I didnt knew the use of this file, now it's done. Theme is a brand new one, coded by my hands from new Default.

thanks!

2010/3/29 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Mar 30, 2010, 4:04:57 AM3/30/10
to in-por...@googlegroups.com
In my previous post I forgot to mention, that after proper .smsignore will be added, then no "_Auto:" pages will be created on next theme scan.

Phil -- wbtc.fr --

unread,
Mar 30, 2010, 12:25:12 PM3/30/10
to in-por...@googlegroups.com
yes, it works :) thanks

2010/3/30 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
Mar 31, 2010, 2:05:56 AM3/31/10
to In-Portal Development Team
Hi guys,

Here are my thoughts on this:

1. I think it's a good idea to change wording for System so it's more
descriptive, how about "From Template" or "Template". I think 1st is
more descriptive considering that column name is "Type".

2. I would keep IsSystem and add Protected field, so it can be applied
to ANY Section. In the end we'll have the following combinations:

a. User and Protected (Yes)
b. User and Protected (No)
c. From Template and Protected (Yes)
d. From Template and Protected (No)


About why we disallowed Deletion of System sections for Users - I
think the same reason we are having this conversation + it would keep
growing the IDs.

3. I would make ALL System (new Form Template) - Protected by default
- so can't be deleted (if deleted still restored with Refresh in
Themes).

4. I would limit deletion of Protected to DBG for now and then we'll
see if further break down on Permissions is needed. We should start
thinking about simpling permissions


DA.

On Mar 30, 11:25 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> yes, it works :) thanks
>

> 2010/3/30 Alexander Obuhovich <aik.b...@gmail.com>


>
>
>
> > In my previous post I forgot to mention, that after proper .smsignore will
> > be added, then no "_Auto:" pages will be created on next theme scan.
>

> > On Mon, Mar 29, 2010 at 11:25 PM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> I didnt knew the use of this file, now it's done. Theme is a brand new
> >> one, coded by my hands from new Default.
>
> >> thanks!
>

> >> 2010/3/29 Alexander Obuhovich <aik.b...@gmail.com>


>
> >>> He probably have theme not compatible with 5,x release (like onlinestore
> >>> theme now). He should add ".smsignore" file in each directory for each theme
> >>> with ".*" in it. Then delete all "_Auto: ..." pages. Then press "Refresh" on
> >>> "Themes" section. If he did all correct, then no new sections with red icons
> >>> will be created.
>
> >>> On Mon, Mar 29, 2010 at 5:23 PM, Phil ..:: domicilis.biz ::.. <
> >>> p...@domicilis.biz> wrote:
>
> >>>> By the way, is there a way to hide these "light red" system folder for
> >>>> admin (and root) users?
> >>>> Root user could still activate this view, but standard admin wouldn't be
> >>>> able to do so.
>
> >>>> For example, I have a customer who have many different theme files, and
> >>>> he don't understand why he have dozens of "_Auto: design/xxx" in his
> >>>> admin...
>

> >>>> 2010/3/29 Alexander Obuhovich <aik.b...@gmail.com>


>
> >>>>>  I can't really remember why we needed protection against system page
> >>>>> deletion at all. When system page is deleted, then associated physical
> >>>>> template is not deleted. Then user can use "Refresh" button in "Themes"
> >>>>> section and our section, that we just deleted by accident will be back in no
> >>>>> time.
>
> >>>>> At the end I see this like this:
>

> >>>>>    1. add new field "Protected" (Yes/No) on category editing page and


> >>>>>    maybe in grid, but hidden by default;

> >>>>>    2. remove inability to delete system pages;
> >>>>>    3. add new permission named "Delete Protected Sections" (and check


> >>>>>    it for "root" user too);

> >>>>>    4. maybe in debug mode virtually give that permission to any user
> >>>>>    in administrative console;
> >>>>>    5. when user tried to delete protected section without proper

Alexander Obuhovich

unread,
Apr 3, 2010, 3:40:00 PM4/3/10
to in-por...@googlegroups.com
Maybe that IsSystem field should be renamed to PageType with possible values: physical/real/template (1) and virtual (2) (we use that term a lot). Lets keep rule, that non-virtual pages (1) can only be deleted in debug mode and they have input box (not dropdown) in debug mode only, when developer can see actual physical template being used.

If we rename IsSystem column this way, then it will make more sense without adding new Protected column. We can also show nice notice when user tries to delete non-virtual pages, like "It is forbidden to delete non-virtual pages".

Of course "non-virtual" term I used here will be replaced to proper wording from: physical, real, template.

Dmitry Andrejev

unread,
Apr 3, 2010, 3:49:51 PM4/3/10
to in-por...@googlegroups.com
Hi Alex,


Sounds like a good approach to solve the issue.

In my opinion we should:

1. Rename IsSystem column to PageType with two options:

a. Template (since directly connected with template)
b. Virtual

Who else has an opinion on this (ie. Sergey) please post here!


DA

Alexander Obuhovich

unread,
Apr 3, 2010, 3:57:54 PM4/3/10
to in-por...@googlegroups.com
Also adapt code (if needed) to mark container pages created during "advanced" (can be any else theme) scan to be marked with "Template" type and will be working as usual. Other seems ok.

Dmitry A.

unread,
Apr 4, 2010, 10:11:33 PM4/4/10
to In-Portal Development Team
Agreed!

Sergey and others - would you please review our discussion and post
your opinion in here since you were involved in the talk too.

Once confirmed we can convert this to the task.

Cheers!

DA.

On Apr 3, 2:57 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> Also adapt code (if needed) to mark container pages created during
> "advanced" (can be any else theme) scan to be marked with "Template" type
> and will be working as usual. Other seems ok.
>

> On Sat, Apr 3, 2010 at 10:49 PM, Dmitry Andrejev <dandre...@gmail.com>wrote:
>
>
>
>
>
> > Hi Alex,
>
> > Sounds like a good approach to solve the issue.
>
> > In my opinion we should:
>
> > 1. Rename IsSystem column to PageType with two options:
>
> > a. Template (since directly connected with template)
> > b. Virtual
>
> > Who else has an opinion on this (ie. Sergey) please post here!
>
> > DA
>

> > On Sat, Apr 3, 2010 at 2:40 PM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
> >> Maybe that IsSystem field should be renamed to PageType with possible
> >> values: physical/real/template (1) and virtual (2) (we use that term a lot).
> >> Lets keep rule, that non-virtual pages (1) can only be deleted in debug mode
> >> and they have input box (not dropdown) in debug mode only, when developer
> >> can see actual physical template being used.
>
> >> If we rename IsSystem column this way, then it will make more sense
> >> without adding new Protected column. We can also show nice notice when user
> >> tries to delete non-virtual pages, like "It is forbidden to delete
> >> non-virtual pages".
>
> >> Of course "non-virtual" term I used here will be replaced to proper
> >> wording from: physical, real, template.
>

S.G.

unread,
Apr 5, 2010, 5:06:22 AM4/5/10
to In-Portal Development Team
Two last Alex's posts make sense, I completely agree, but initial
thread open reason stays unresolved: what should developer do when he
wants to create default-design-type page, but this page needs not to
be deleted (it may be used in any fixed link on site, for ex. Contacts
link on every page)? We leave it as it is today - developer creates
template with only one includу tag?

Alexander Obuhovich

unread,
Apr 5, 2010, 4:38:27 PM4/5/10
to in-por...@googlegroups.com
No, he created pages manually (as before), but he specifies, that this page has PageType = Template (field editable only in debug mode).

S.G.

unread,
Apr 6, 2010, 3:33:13 AM4/6/10
to In-Portal Development Team
"PageType = Template" for page that is not template? This is unclear.
Again, some option renaming may help. Or may be we should add one more
option for type, such as Protected?

On Apr 5, 11:38 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> No, he created pages manually (as before), but he specifies, that this page
> has PageType = Template (field editable only in debug mode).
>

> ...
>
> read more »

Alexander Obuhovich

unread,
Apr 6, 2010, 3:42:06 AM4/6/10
to in-por...@googlegroups.com
As I've mentioned before:
  • PageType = Template: page, that uses physical template backend and therefore can't be deleted
  • PageType = Virtual: page, that uses common design template backend and can be deleted

Dmitry Andrejev

unread,
Apr 6, 2010, 8:25:46 AM4/6/10
to in-por...@googlegroups.com
I think Sergey meant to say what about Container sections that are created whenever we scan the Theme and place Real Template Section inside Container ones - does it make sense to call them PageType = Template?

Yes, I think so.

The other advantage of Protected can be that we do NOT want Users to delete even some regular Sections (pages) - so structure is no broken.


DA.

Alexander Obuhovich

unread,
Apr 6, 2010, 8:43:11 AM4/6/10
to in-por...@googlegroups.com
So what difference in code processing is between "Template" and "Protected" PageTypes?

Dmitry Andrejev

unread,
Apr 6, 2010, 8:46:47 AM4/6/10
to in-por...@googlegroups.com
I guess Protected can be ANY Section (PageType = Template or Virtual)?

It me it makes sense. For user it will apply to Virtual in most cases, why in Admin with DBG you can delete ANY section?

DA.

Alexander Obuhovich

unread,
Apr 6, 2010, 8:54:45 AM4/6/10
to in-por...@googlegroups.com
So we are back to original post about creating new Protected (Yes/No) field plus renaming IsSystem to PageType.

S.G.

unread,
Apr 7, 2010, 2:55:19 AM4/7/10
to In-Portal Development Team
Dmitry,

I'm only against making unclear things. Developers won't understand
that page has type Template when there's no physical template for it.

Alex,

In my opinion, processing will be the same, except one thing: for
Protected page user will be able change design (since it's virtual),
but not for Template page.

On Apr 6, 3:54 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> So we are back to original post about creating new Protected (Yes/No) field
> plus renaming IsSystem to PageType.
>

> On Tue, Apr 6, 2010 at 3:46 PM, Dmitry Andrejev <dandre...@gmail.com> wrote:
> > I guess Protected can be ANY Section (PageType = Template or Virtual)?
>
> > It me it makes sense. For user it will apply to Virtual in most cases, why
> > in Admin with DBG you can delete ANY section?
>
> > DA.
>

> > On Tue, Apr 6, 2010 at 7:43 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
> >> So what difference in code processing is between "Template" and
> >> "Protected" PageTypes?
>

> >> On Tue, Apr 6, 2010 at 3:25 PM, Dmitry Andrejev <dandre...@gmail.com>wrote:
>
> >>> I think Sergey meant to say what about Container sections that are
> >>> created whenever we scan the Theme and place Real Template Section inside
> >>> Container ones - does it make sense to call them PageType = Template?
>
> >>> Yes, I think so.
>
> >>> The other advantage of Protected can be that we do NOT want Users to
> >>> delete even some regular Sections (pages) - so structure is no broken.
>
> >>> DA.
>

> >>> On Tue, Apr 6, 2010 at 2:42 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
> >>>> As I've mentioned before:
>

> >>>>    - PageType = Template: page, that uses physical template backend and


> >>>>    therefore can't be deleted

> >>>>    - PageType = Virtual: page, that uses common design template backend
> >>>>    and can be deleted

> ...
>
> read more »

Phil -- wbtc.fr --

unread,
Apr 7, 2010, 3:07:14 AM4/7/10
to in-por...@googlegroups.com
Hello guys,

Sergey, I don't understand why you say there's no "physical template", as the virtual category is created when inportal finds a design. I've missed something?

It seems we don't use the exactly the same terminology and thus we don't understand our thought :)

Phil.

2010/4/7 S.G. <serg...@gmail.com>


--
To unsubscribe, reply using "remove me" as the subject.

Alexander Obuhovich

unread,
Apr 7, 2010, 3:43:20 AM4/7/10
to in-por...@googlegroups.com
Ok for Dmitry's post.

Phil, there 3 types of pages that can exist based on this discussion:
  • virtual - user adds manually and specifies design from dropdown (it's called "virtual" since multiple pages are using same design template);
  • template - is only added automatically during theme scan and nobody can change it's template (called "template", since it's only page, that uses given template in theme, which by the way is not design template); also that pages can only be deleted while in debug mode only;
  • protected - it's virtual pages + page can only be deleted while in debug mode only; and user can change it's design from dropdown.

Seems, that we are moving forward to task creation.

Phil -- wbtc.fr --

unread,
Apr 7, 2010, 3:53:17 AM4/7/10
to in-por...@googlegroups.com
Alex,

Thank for this clear explanation. Sergey said that users cannot modify "template pages"... but I do it everyday using "Design mode", where is the trick I didn't understoud?

p.

2010/4/7 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Apr 7, 2010, 3:56:12 AM4/7/10
to in-por...@googlegroups.com
Sergey meant page editing screen of course not design mode.

Dmitry Andrejev

unread,
Apr 8, 2010, 9:14:39 AM4/8/10
to in-por...@googlegroups.com
Hi guys,


We are close, but I think the following should make sense:

Let's limit "CAN DELETE in DEBUG ONLY" to page that are marked as Protected!

Thus we would have Columns:

PageType:
- Virtual (User added)
- Template (generated from Theme Template)

Protected:
- Yes
- No


1. By default pages with PageType=Template will be Protected (when
generated) include Container pages
2. Any other page (Virtual) can be marked as Protected.

I would also consider LIMIT editing options for regular Users on
Protected pages.

Example, can NOT:
- Delete
- Change Design
- Change Status
- Change Name (Rename)? leads to different Filename...


Let me know

DA.

Alexander Obuhovich

unread,
Apr 8, 2010, 9:38:33 AM4/8/10
to in-por...@googlegroups.com
Renaming is ok, since links to physical pages don't use their filename unless user explicitly asks for that (adding use_section="1" to m_Link tag). Are you should that new Protected field is better, then new Protected option for PageType (former IsSystem) field?

Dmitry Andrejev

unread,
Apr 8, 2010, 9:49:22 AM4/8/10
to in-por...@googlegroups.com
As Sergey said (and I confirm) - less confusion when you draw a clear
line what's Virtual what's Template section and either can be
Protected (Template ones by default).

I say we apply the same rules to Protected pages for everything.

DA.

Alexander Obuhovich

unread,
Apr 8, 2010, 10:04:41 AM4/8/10
to in-por...@googlegroups.com
Ok, now we are ready for task I assume. That one will go directly to 5.0.4.

Dmitry A.

unread,
Apr 9, 2010, 12:21:00 AM4/9/10
to In-Portal Development Team
Task has been filed:

683: Preventing the Deletion of specific Sections in the Catalog

http://tracker.in-portal.org/view.php?id=683


PLEASE review and comment here if I have missed anything in the task
(after long discussion).


DA.

On Apr 7, 2:53 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> Alex,
>
> Thank for this clear explanation. Sergey said that users cannot modify
> "template pages"... but I do it everyday using "Design mode", where is the
> trick I didn't understoud?
>
> p.
>

> 2010/4/7 Alexander Obuhovich <aik.b...@gmail.com>


>
>
>
> > Ok for Dmitry's post.
>
> > Phil, there 3 types of pages that can exist based on this discussion:
>

> >    - virtual - user adds manually and specifies design from dropdown (it's


> >    called "virtual" since multiple pages are using same design template);

> >    - template - is only added automatically during theme scan and nobody


> >    can change it's template (called "template", since it's only page, that uses
> >    given template in theme, which by the way is not design template); also that
> >    pages can only be deleted while in debug mode only;

> >    - protected - it's virtual pages + page can only be deleted while in


> >    debug mode only; and user can change it's design from dropdown.
>
> > Seems, that we are moving forward to task creation.
>

> > On Wed, Apr 7, 2010 at 10:07 AM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> Hello guys,
>
> >> Sergey, I don't understand why you say there's no "physical template", as
> >> the virtual category is created when inportal finds a design. I've missed
> >> something?
>
> >> It seems we don't use the exactly the same terminology and thus we don't
> >> understand our thought :)
>
> >> Phil.
>

> >> 2010/4/7 S.G. <sergb...@gmail.com>

> ...
>
> read more »

Phil

unread,
May 21, 2010, 6:03:21 PM5/21/10
to In-Portal Development Team
Hello guys,

On 503, Inportal scanned a theme before I remembered to put
an .smsignore file at root of theme, and now my matter is to know how
to delete theses red icon system's files in three:$

thanks
Phil.

On Apr 7, 9:53 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> Alex,
>
> Thank for this clear explanation. Sergey said that users cannot modify
> "template pages"... but I do it everyday using "Design mode", where is the
> trick I didn't understoud?
>
> p.
>
> 2010/4/7 Alexander Obuhovich <aik.b...@gmail.com>
>
> > Ok for Dmitry's post.
>
> > Phil, there 3 types of pages that can exist based on this discussion:
>
> >    - virtual - user adds manually and specifies design from dropdown (it's
> >    called "virtual" since multiple pages are using same design template);
> >    - template - is only added automatically during theme scan and nobody
> >    can change it's template (called "template", since it's only page, that uses
> >    given template in theme, which by the way is not design template); also that
> >    pages can only be deleted while in debug mode only;
> >    - protected - it's virtual pages + page can only be deleted while in
> >    debug mode only; and user can change it's design from dropdown.
>
> > Seems, that we are moving forward to task creation.
>
> > On Wed, Apr 7, 2010 at 10:07 AM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> Hello guys,
>
> >> Sergey, I don't understand why you say there's no "physical template", as
> >> the virtual category is created when inportal finds a design. I've missed
> >> something?
>
> >> It seems we don't use the exactly the same terminology and thus we don't
> >> understand our thought :)
>
> >> Phil.
>
> >> 2010/4/7 S.G. <sergb...@gmail.com>
> ...
>
> read more »

Alexander Obuhovich

unread,
May 22, 2010, 3:17:57 AM5/22/10
to in-por...@googlegroups.com
Only manually. Since they all starts with "_Auto:" and are located in top category, then it's no problems to find them by simply searching them by name.

Phil -- wbtc.fr --

unread,
May 22, 2010, 5:31:28 AM5/22/10
to in-por...@googlegroups.com
I select them and clic on "delete", but this isn't enough, they still
remain alive :)

2010/5/22 Alexander Obuhovich <aik....@gmail.com>:

Alexander Obuhovich

unread,
May 22, 2010, 5:35:11 AM5/22/10
to in-por...@googlegroups.com
If you remember whole discussion, then you can't just delete them, since they map to real templates. You must be in debug mode to do that.

Phil -- wbtc.fr --

unread,
May 22, 2010, 5:37:05 AM5/22/10
to in-por...@googlegroups.com
ok, thanks for the remembering :)
Reply all
Reply to author
Forward
0 new messages