Issue Details (XML | Word | Printable)

Key: APF-805
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Matt Raible
Reporter: Matt Raible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

User is not allowed to change their username

Created: 06/Jun/07 02:36 PM   Updated: 06/Jun/07 04:01 PM   Resolved: 06/Jun/07 04:01 PM
Component/s: Security
Affects Version/s: 2.0-M5
Fix Version/s: 2.0-RC1


 Description  « Hide
To recreate the bug using a default AppFuse Struts2 modular app do the following:

1) start the webapp (mvn jetty:run)
2) login as "user/user"
3) edit the user profile, change the Username to "user2"
4) press Save button

See this error:

Yikes!
org.acegisecurity.AccessDeniedException: Access Denied: Only administrators are allowed to modify other users.
at org.appfuse.service.UserSecurityAdvice.before(UserSecurityAdvice.java:63)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:49)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy22.saveUser(Unknown Source)
at org.appfuse.webapp.action.UserAction.save(UserAction.java:155)
[SNIP]

Problem: Users should be able to change their username. UserSecurityAdvice checks for users based on username when it should check based on id.

Discovered thanks to APF-800.


2784 by  Matt Raible (2 files)
06/Jun/07 03:57 PM (38 months, 6 days ago)
APF-805: User should be able to change their username. Fixed by changing UserSecurityAdvice to compare on user's id instead of username.
appfuse: trunk/service/src/main/java/org/appfuse/service/UserSecurityAdvice.java 2784 history download (+52 -48) diffs
appfuse: trunk/service/src/test/java/org/appfuse/service/UserSecurityAdviceTest.java 2784 history download (+32 -14) diffs

Matt Raible added a comment - 06/Jun/07 04:01 PM

Matt Raible made changes - 06/Jun/07 04:01 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]