|
Re: Multisession login [message #1798078 is a reply to message #1798042] |
Mon, 12 November 2018 08:56 |
|
Luka Cavic wrote on Sun, 11 November 2018 12:58
1. Can I have two logins in application, one for users and one for clients?
2. Can I have two login screens, one for users (default one) and create another for clients, for example URL: http://myapplocation.com/client/login?
Just change your security filter accordingly, so that it checks both tables. Or maybe you can even recognize the user type from the username pattern? You may also have to adjust the "execLoad" part of the session (load data from one or the other table).
Both user types will use the same application, but Permissions control which elements are visible and available. Permissions are assigned to the user session by the "...AccessControlService". You can implement any logic you want to create java.security.Permission objects. In the specific elements (menus, outlines, pages, forms etc.) you can then check if the user has a specific permission using the ACCESS.check() helper.
Examples:
Page:
...
@Override
protected boolean execCalculateVisible() {
return ACCESS.check(new ReadInternalDataPermission());
}
...
Menu:
...
@Override
protected void execInitAction() {
setVisibleGranted(ACCESS.check(new DeleteReportPermission());
}
...
Regards,
Beat
|
|
|
|
Re: Multisession login [message #1798089 is a reply to message #1798083] |
Mon, 12 November 2018 09:58 |
|
Luka Cavic wrote on Mon, 12 November 2018 04:14But I would like to have two login screens, one for users, one for clients? Is that possible?
Basically, yes, but it requires a lot of adjustments. You start by copying login.html and login.js, adjusting the auth path and then work your way through. The security filters have to be customized, because they all use /auth by default.
The easier way would probably be to copy login.html/login.js and adjust the java script code such that it automatically adds the "client_" prefix before submitting. This saves you from duplicating everything on the server side but does not show the "ugly" prefix to the user.
Another possibility would be to deploy a second *.ui.html application with a different configuration (but connecting to the same backend).
Regards,
Beat
|
|
|
Powered by
FUDForum. Page generated in 0.03110 seconds