Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 457473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:34:29+00:00 2026-05-12T22:34:29+00:00

I am writing a web app in Grails with the Acegi/Spring Security plug-in, and

  • 0

I am writing a web app in Grails with the Acegi/Spring Security plug-in, and am having trouble getting it to see changes I make to User instances. I have only been working with Groovy/Grails for about three weeks, so please forgive me if this problem is trivial, since I have been poring over mailing lists and tutorials trying to find the answer.

I have been adding new attributes to the User domain class whenever I need a User to contain more information such as an email confirmation token or real name, since I couldn’t find any recommendations to the contrary. Everything seems to be fine for creating new users, but when I edit the user, the changes show up in the user list, but the Acegi tag libraries and associated functions don’t seem to see the changes.

Here is the relevant snippet from UserController.update():

def person = User.get(params.id)
//...snip error checking...

//Update user attributes
person.username = params.email
person.email = params.email
person.userRealName = params.userRealName

//Attempt to save changes
if (person.save()) {
    //If successful, redirect back to profile viewing page
    redirect action: show, id: person.id
    return
}
else {
    //Otherwise, show errors and edit again
    render view: 'edit', model: buildPersonModel(person)
    return
}

After this code runs, I can see the changes if I always get user data by ID, but not if I use the Acegi tags or functions. For example, this does not work:

loggedInUserInfo(field:'realName')

But this does:

User.get(loggedInUserInfo(field:'id').toLong()).realName

The new information sometimes shows up after I log out and in again, but usually it doesn’t, often not showing up even after three or more relogs. Also, I tried adding “flush:true” to person.save() with no effect.

(Peripheral question: is it bad for me to be fiddling with the User class like this? If not, what’s the best way to add information to it?)

Update after more investigation:
It looks like if I use loggedInUserInfo() in a normal page, it works fine, but if I use it inside a layout, it exhibits the behavior I described. Could there be some odd caching thing going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:34:29+00:00Added an answer on May 12, 2026 at 10:34 pm

    I have a workaround for this issue and i’ve also created a JIRA entry for the problem.

    There seems to be a bug in how Acegi updates it’s users internally. I provide a workaround in the form of a grails filter which updates the user’s authorities manually every time a controller is accessed. Not ideal but it works.

    Cheers,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a web app using grails and spring-security 3.0.3 which requires me to
I'm writing a web app, and I'm having a serious problem with too much
I am writing a web app which will allow the user to specify a
I'm writing a web app. Based on certain choices the user selects, it dynamically
I am writing Web app in java using Spring Web MVC framework. Somehow validation
I'm writing a web app in PHP (using Codeigniter). I'm just wanting some security
I am writing a web app that uses HTML5 audio. I want to make
We're writing our own web app and we need the user to have a
I am writing an web app, in which a user can create group and
I'm writing a web app that is getting too complex and I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.