how can I implement JDBCRealm for user with different roles in each group?

StackOverflow https://stackoverflow.com/questions/12337134

  •  01-07-2021
  •  | 
  •  

Вопрос

I want to use JDBCRealm for login authentication but instead of having a user_role table I have a groups table which has pointer to the group tables each containing user and it's role in that group,how should I implement JDBCRealm for this case?

thank you

Это было полезно?

Решение

You cannot use JDBCRealm for this purpose: you will have to write your own subclass of JDBCRealm and change the queries used for authorization.

Another tip: don't use JDBCRealm at all: it does not scale at all since there is a single JDBC Connection object used for all database communication. You are better off using DataSourceRealm.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top