NetTalk Central

Author Topic: user must >= level  (Read 3116 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
user must >= level
« on: April 19, 2018, 10:36:28 AM »
user must >= level
What exactly does one put there

I have users and userlevels tables.
Login and password is verified against users and the userlevel is in the same table usr:userlevel.
Must I SSV this usr:userlevel on login and here I put the GSV?

OK resolved.
p_web.GSV('loggedinuseruserlevel') did the trick.
Couldn't find this any docs.

Wait - what did it verify it against?

« Last Edit: April 19, 2018, 01:10:10 PM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: user must >= level
« Reply #1 on: April 19, 2018, 01:47:40 PM »
OK
I log in - my userlevel = 0
p_web.GSV('loggedinuseruserlevel') goes into =>
In the other <= put 0
Therefore only users with userlevel 0 can see this page?

Have I got it now?
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: user must >= level
« Reply #2 on: April 19, 2018, 10:01:17 PM »
Hi Johan,

I'm not sure, but no, I don't think you've got it.

When a user authenticates you can set their user level,

p_web.SetSessionLevel(x)

Then in the templates, where you see those Level settings, it's using p_web.GetSessionLevel and comparing against that.

What the levels "mean" and how they are allocated to users, is up to you.

cheers
Bruce

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: user must >= level
« Reply #3 on: April 20, 2018, 10:17:08 PM »
Hi Johann,

If it helps here how I do it:

For each user I have a type field
That type sets the user level usuall between an upper and lower number (This gives me room to manouver if I need to.
I set a user level on the menu choices - This allows me to show or not the menu choices for specific users.
I start with low levels have less access and the higher levels having more.

This is one area some of my customers struggle with so the type record attached to the staff table helps a lot when they are entering new staff and customer members.

You really need to sit down and map out your users and what they require and that makes it much easier to implement.

Hope this helps.

Brian.
Brian

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: user must >= level
« Reply #4 on: April 21, 2018, 04:26:19 AM »
Hi
Thx for that!
In my users table I have usr:userlevel
After login in webhandler
p_web.SSV('loggedinuseruserlevel',usr:userlevel)
p_web.SetSessionLevel(p_web.GSV('loggedinuseruserlevel'))

in Menu choice I have set the two levels to 0 and 0.
So if userlevel is <> 0 then that menu choice is hidden.

I have it that low levels have more access ...
I don't suppose that is serious?
'
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: user must >= level
« Reply #5 on: April 22, 2018, 09:57:09 PM »
you can have low levels as more access, or high levels as more access - NetTalk doesn't care.

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: user must >= level
« Reply #6 on: April 23, 2018, 12:55:50 AM »
I'm sure NetTalk won't mind LOL-  but I was thinking more in the line of Business Rules, conventions, logic, common sense.
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: user must >= level
« Reply #7 on: April 23, 2018, 02:02:30 AM »
I have a roles table that sets the security level when a new staff member is created.  This shields the user from having to set the level so high or low does not matter.
I happen to have higher as more access.  The admin user can override this setting of course.
I also use levels on tabs as well so that for some levels they can see a record but not all the tabs on a form.

Brian.
Brian