You are not logged in.
Pages: 1
I want to create a method based service which works for both logged in and anonymous users. Is it safe to do something like this?:
procedure TMySQLRestServer.search(cTxt: TSQLRestServerURIContext);
begin
if cTxt.SessionGroup = 0 then
//return results for anonymous users
else
//return results for logged in users
end;
I only ask as the code comments
/// the corresponding TAuthSession.User.GroupRights.ID value
// - is undefined if Session is 0 or 1 (no authentication running)
SessionGroup: integer;
but it seems that I can rely on SessionGroup being 0 rather than undefined if no authentication is running.
Offline
Sorry, I misread undefined in the comments as uninitialised.
Offline
Pages: 1