Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 18:30:10 +0000



DLL Authorization Checks (UserServiceLevel)

View Count: 360

[2023-01-21 17:52:37]
SavantTrader - Posts: 110
I'd like to add UserServiceLevel to my existing implementation of UserAllowed checks. Can someone familiar with UserServiceLevel help me complete this implementation:


  // check authorization to run our DLL
  int ServiceLevel = 0x16;
  if (sc.IsUserAllowedForSCDLLName == false || sc.DLLNameUserServiceLevel != ServiceLevel)
  {
    if(sc.Index == 0) { // only pollute logfile once, at start
      SCString pre = "You are not authorized to use this amazing study. Contact ";
      sc.AddMessageToLog( pre + ContactEmail + " to discuss authorization.",1);
    }
    return;
  }

Specifically, can someone tell me:

1) Should I use an unsigned long for ServiceLevel?
2) Is my "all in one" implementation logic correct?
3) If I wanted items with ServiceLevel = 0 to always bypass this, but with a valid registered user still required, is there a (code) clean way to implement the logic?
4) What's the easiest way to implement bitmask user levels?

Thank you!
Date Time Of Last Edit: 2023-01-21 18:24:13
[2023-01-21 19:07:36]
Sierra_Chart Engineering - Posts: 17233
1. Use std::int64_t


2. Your code looks fine.

3, 4. This is in the area of programming help. You need to work out these details.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account