Get role from logged in user?

Hi!

I want to get the active users role. I´ve searched a lot now and can´t seem to find a function for it like UserInfo.

My "sollution" as for now is to roll through the USERS.RDB and get it from there, but there must be a better way?

/Anders

Current "sollution": (Pasting it here removes the indents. Oh well..)

FUNCTION SFA()

STRING sROLE
STRING sUserRDB
STRING sUserIn = UserInfo(1)
INT hRdb
INT nRecord

hRdb = RdbOpen("_USERS")
IF (hRdb <> -1) THEN
nRecord = RdbFirstRec(hRdb)
WHILE (nRecord <> -1)DO
sUserRDB = RdbGet(hRdb, "NAME")
IF sUserRDB = sUserIn THEN
sROLE = RdbGet(hRdb, "ROLES")
nRecord = -1
ELSE
nRecord = RdbNextRec(hRdb)
END

END
RdbClose(hRdb)
END

END

Parents Reply Children
No Data