I would like to improve the performance of my JSF Web application. Currently I stored a lot of permisson fields in the database as String. I´m using a lot ot "rendered" in the JSF page to check if the user is allowed to see the link / datatable. For each "rendered" I have a request to my JSF bean (this is RequestedScoped). My question is: Is it better to use instead of RequestedScoped a SessionScoped which holds the Permission object?
Currently:
<p:menuitem value="Test"
rendered="#{permissionCheckController.checkPermission(null, 'CREATE_COMMENT')}" />
checkPermission() includes round about 80 if conditions to check if the user is allowed to see/use the functionality and return true or false. In this example for "CREATE_COMMENT".
Is it better to use for example (and set the Bean to SessionScoped):
<p:menuitem value="Test"
rendered="#{permissionCheckController.myPermissionobject.createComment}" />
Thank you fr any feedback
Aucun commentaire:
Enregistrer un commentaire