DMXzone Security Provider PHP Support Product Page

Answered

Show region by security level

Asked 17 Feb 2014 19:04:54
6
have this question
17 Feb 2014 19:04:54 Brad Lawryk posted:
How can I set different regions to show or hide based on user level? The video only shows how to restrict a data source.

For example I Have menu items that should only show up if logged in as an admin level. The rest of the menu items should show for everyone. Really has nothing to do with the data.

Replies

Replied 17 Feb 2014 19:07:51
17 Feb 2014 19:07:51 Brad Lawryk replied:
Do I need to create a data source for each level and show hid based on if that datasource exists or not?
Replied 18 Feb 2014 16:22:47
18 Feb 2014 16:22:47 Teodor Kuduschiev replied:
Hi Brad,
There is a session variable that stores the userid: dmxSecurityId
You can use it with the DMXzone Database Formatter and hide/show regions if the dmxSecurityId equals some value.
Replied 18 Feb 2014 16:30:06
18 Feb 2014 16:30:06 Brad Lawryk replied:
yeah I tried that but it doesn't seem to support buttons? There is only options for divs, various types of form fields, etc ... but no option for buttons.

Anyways, I did use the datasource method which did give me plenty of control over the content. You can mark as solved. Thanks!
Replied 18 Feb 2014 16:57:40
18 Feb 2014 16:57:40 Teodor Kuduschiev replied:
You can wrap your buttons inside <span>
Replied 16 Aug 2015 17:59:53
16 Aug 2015 17:59:53 manuel pinto replied:
Is it possible to have a video tutorial about show/hide regions based on session variable that stores the userid: dmxSecurityId and with the DMXzone Database Formatter ?
Replied 16 Aug 2015 18:26:15
16 Aug 2015 18:26:15 Brad Lawryk replied:
Replied 16 Aug 2015 18:34:11
16 Aug 2015 18:34:11 manuel pinto replied:
Not exactly this. I have a div with some text inside where only want to show when the user login is an admin and not a simple user, I try the suggestion using the userid: dmxSecurityId but not working ... don't know why!
Replied 10 Sep 2015 01:18:58
10 Sep 2015 01:18:58 sanjeev jayswal replied:
The security extension has option to set multiple levels, I have set 3 levels, admin, super & user.
Post validation, I want the admin to see 1 set of menu, super another set of menu and user sees a third set of menu.
How is it possible, the dreamwever server behavior used to have a session variable for user level which was useful for this kind of features.
How can we implement this with DMX extension

Replied 10 Sep 2015 02:13:41
10 Sep 2015 02:13:41 Brad Lawryk replied:
This tutorial should help: www.dmxzone.com/go/22542/restricting-access-based-on-user-permissions

You can also set a session variable for each level in the Data bindings panel. Create a recordset filtered by the dmxSecurityId session variable. Create a new session variable in the Data Bindings Panel and bind it to the level value in your database.

Wrap your menus in span tags and apply the show.data bindings to that span tag. I hope that makes some sense.
Replied 10 Sep 2015 19:04:41
10 Sep 2015 19:04:41 manuel pinto replied:
Wish that dmxzone upgrade the extension or at least insert a video tutorial on how to restrict div areas on a page depending on user levels. If i restric access to a page for admin and users, how can i show a specif area only for admin users?
Replied 11 Sep 2015 03:21:38
11 Sep 2015 03:21:38 sanjeev jayswal replied:
I know it is possible with dreamwever's server behaviour, but is it possible with dmx zone extension?
In the answer provided by Brad, I am not able to understand the solution, please provide a step wise guide.

I am new in dmxzone, not able to see a option on how to create a new session variable even

Thanks in advance for your effort
Replied 19 Dec 2015 05:28:03
19 Dec 2015 05:28:03 Firdaus Rohman replied:
why the video is deleted??????????
Replied 02 Dec 2016 09:51:09
02 Dec 2016 09:51:09 Greta Garberini replied:
The video is still not available. Is there an updated version? Where can we find it?
Replied 02 Dec 2016 10:16:49
02 Dec 2016 10:16:49 Greta Garberini replied:
Well, in the meantime it has become easy:
  1. create a region and make an id for it (for ex. id="adminonly"
  2. select this id and make sure the whole area is highlighted
  3. select the executor's accesslevel field and click on "show"
  4. format it and add conditional whatever your accesslevel is made of (1=admin, 2=user etc)
  5. the downside ob this method is, it is shown in the page's source code so I wonder if there is a better way to do it on server-side

  6. Would be nice to have a hint on this
Replied 02 Dec 2016 10:48:05
02 Dec 2016 10:48:05 Teodor Kuduschiev replied:
If you want to protect the page content you should use the security provider enforcer.
If you want to protect a query from being accessed use the restrict step in the action file.
Replied 02 Dec 2016 11:40:18
02 Dec 2016 11:40:18 Greta Garberini replied:
Ok, thanks

Reply to this topic