#1 mORMot 2 » How to retrieve additional fields from user table with user rights? » 2025-01-22 22:47:10

MoJoMe
Replies: 0

Hello everyone,

I’m encountering an issue with user authentication in my client/server application. I’ve created a TUser class that inherits from TAuthUser and adds some additional fields.
However, I’m having trouble retrieving these additional fields after authenticating a user with user rights (TAuthGroup 'User').

From my understanding of the comments in TAuthGroup, an authenticated user with user rights should be allowed to access their own data in the user table:

// - 'User' won't have the reSqlSelectWithoutTable flag, nor the right 
// to retrieve the Auth tables data for other users 

Unfortunately, in this case the status of the request is set to HTTP_NOTALLOWED inside of the TRestServerUriContext.ExecuteOrmGet method because the User table is of course not included in the AccessRights. Therefore, access to the user's own data is also blocked.

Is there a way to retrieve these additional fields with user rights? Or would it be better to move the additional fields to a separate table?

Thanks in advance.

Board footer

Powered by FluxBB