X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fmodel%2FEcompUserDetails.java;h=3a082062b967a45e6f49dda95770237f786881db;hb=592ce20ec359928373de2e7f06214c8f8ad73c20;hp=7bc9f0044e3ff97e60b0c2a4b558e8f0ea8b70f5;hpb=7a4a590fb0ebf8772169625cdda327da43c79c6d;p=nonrtric.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java index 7bc9f004..3a082062 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java @@ -32,54 +32,54 @@ import org.springframework.security.core.userdetails.UserDetails; public class EcompUserDetails implements UserDetails { - private static final long serialVersionUID = 1L; - private final EcompUser ecompUser; + private static final long serialVersionUID = 1L; + private final EcompUser ecompUser; - // This is the default Spring role-name prefix. - private static final String ROLEP = "ROLE_"; + // This is the default Spring role-name prefix. + private static final String ROLEP = "ROLE_"; - public EcompUserDetails(EcompUser ecompUser) { - this.ecompUser = ecompUser; - } + public EcompUserDetails(EcompUser ecompUser) { + this.ecompUser = ecompUser; + } - /* - * Gets a list of authorities (roles) for this user. To keep Spring happy, every - * item has prefix ROLE_. - */ - public Collection getAuthorities() { - List roleList = new ArrayList<>(); - Iterator roleIter = ecompUser.getRoles().iterator(); - while (roleIter.hasNext()) { - EcompRole role = roleIter.next(); - // Add the prefix if the ONAP portal doesn't supply it. - final String roleName = role.getName().startsWith(ROLEP) ? role.getName() : ROLEP + role.getName(); - roleList.add(new SimpleGrantedAuthority(roleName)); - } - return roleList; - } + /* + * Gets a list of authorities (roles) for this user. To keep Spring happy, every + * item has prefix ROLE_. + */ + public Collection getAuthorities() { + List roleList = new ArrayList<>(); + Iterator roleIter = ecompUser.getRoles().iterator(); + while (roleIter.hasNext()) { + EcompRole role = roleIter.next(); + // Add the prefix if the ONAP portal doesn't supply it. + final String roleName = role.getName().startsWith(ROLEP) ? role.getName() : ROLEP + role.getName(); + roleList.add(new SimpleGrantedAuthority(roleName)); + } + return roleList; + } - public String getPassword() { - return null; - } + public String getPassword() { + return null; + } - public String getUsername() { - return ecompUser.getLoginId(); - } + public String getUsername() { + return ecompUser.getLoginId(); + } - public boolean isAccountNonExpired() { - return true; - } + public boolean isAccountNonExpired() { + return true; + } - public boolean isAccountNonLocked() { - return true; - } + public boolean isAccountNonLocked() { + return true; + } - public boolean isCredentialsNonExpired() { - return true; - } + public boolean isCredentialsNonExpired() { + return true; + } - public boolean isEnabled() { - return ecompUser.isActive(); - } + public boolean isEnabled() { + return ecompUser.isActive(); + } }