Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 684 Bytes

java-session-user-hasrole.rst

File metadata and controls

31 lines (18 loc) · 684 Bytes

Session User Role Management

.. seealso::
                | ``class`` sangah.security.SessionUserProfile
                | ``class`` pmis.main.login.LoginForm

SessionUserProfile.hasRole(String role)
Check if the user in session has the passed role. The method check first through the pmis groups and second through the granted authorities on authentication.

java usage:

SessionUtil.getSessionProfile().hasRole("DOC_MGR")

jsp usage:

<c:if test="${login.hasRole('DOC_MGR')}" >
...
</c:if>

Note

The only granted authorities used at this time are ROLE_MASTER and ROLE_ADMIN.