Tech security
Security inside GN5
NOTE: this is about the internal GN5 security. See the GN4-Integration for detail on the GN5->GN4 proxy security.
Overview
- Use
AuthenticationFacadefor most of your authentication needs -
AuthenticationFacade#geonetworkPermissions()has most of the permissions you will need. It is built when a user logs in. It contains;a. Username
b. UserId (as per GN database)
c. HighestProfile (ie. GN database's Profile)
d. Map that goes from Profile -> List of group ids the user has that profile for
e. Map that goes from Group id -> List of profiles that the user has for that profile
NOTE: for anonymous user, they do not have a username/userid or permissions. They only have
Profile.Guestas their highest profile. -
You shouldn't be accessing
Usergroupsor theUsergroupRepository- use theAuthenticationFacadepermissions. - You shouldn't be doing anything with
"ROLE_*"type roles - use theAuthenticationFacadepermissions.