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
Post a Comment