NetTalk Central

Author Topic: Sec:Level - Multiple Ranges?  (Read 4127 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
    • Email
Sec:Level - Multiple Ranges?
« on: September 02, 2024, 06:19:22 AM »
Hi,
I want to have multiple security level ranges - one for user  - e.g. sec:level = 100 -199 and ANOTHER for Administrators  Sec:Level 995-999.
If possible then How?
Thanks,
ROn

rjolda

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
    • Email
Re: Sec:Level - Multiple Ranges?
« Reply #1 on: September 02, 2024, 12:39:39 PM »
Looking at the code, I imagine I could add this code to each procedure:

! Start of "Processed Code"
! [Priority 2800]
        If ~  INRANGE(Sec:LEVEL,100,199)  or ~  INRANGE(Sec:LEVEL,995,999)
            Return -1
        end
       
! Before checking p_Stage
Does this sound correct?
Ron

Jane

  • Sr. Member
  • ****
  • Posts: 371
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Sec:Level - Multiple Ranges?
« Reply #2 on: September 02, 2024, 01:16:12 PM »
Don't know about the secwin part of it, but your code doesn't look logically correct.

Maybe
if ~ (INRANGE(Sec:LEVEL,100,199)  or INRANGE(Sec:LEVEL,995,999))
etc

Richard I

  • Sr. Member
  • ****
  • Posts: 398
    • View Profile
    • Email
Re: Sec:Level - Multiple Ranges?
« Reply #3 on: September 02, 2024, 03:25:58 PM »
Have a look at the Capesoft web  server example "AccessLevels"

Richard

Jane

  • Sr. Member
  • ****
  • Posts: 371
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Sec:Level - Multiple Ranges?
« Reply #4 on: September 02, 2024, 04:00:20 PM »
I don't use secwin and do my own thing for access control within web apps.

Just saying that your IF statement is logically incorrect.

seanh

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
    • Email
Re: Sec:Level - Multiple Ranges?
« Reply #5 on: September 06, 2024, 03:41:35 PM »
I'm curious why you would want so many levels for the same level?
Could you briefly explain? 
In the back of my mind is that for what you want to actually acheive there might be a better way

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Sec:Level - Multiple Ranges?
« Reply #6 on: September 09, 2024, 10:42:07 PM »
Hi,
I want to have multiple security level ranges - one for user  - e.g. sec:level = 100 -199 and ANOTHER for Administrators  Sec:Level 995-999.
If possible then How?

where?