Spring Security add Authorities -


we have migrated spring security 3.0.5 3.2.5. using below code adding authorities.

 userdetails loadeduser = new userdetails();  loadeduser.getauthorities().add(new grantedauthorityimpl("role_admin")); 

now code giving below error

the method add(capture#1-of ? extends grantedauthority) in type collection not applicable arguments (grantedauthorityimpl)

can 1 please me issue ?

there reason why interface grantedauthority provides getter not setter, objects meant immutable. enforce logout/login on permission change , set authorities on object creation this.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -