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

  • SEARCH
  • Home
  • 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 3240726
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:07:05+00:00 2026-05-17T18:07:05+00:00

Grails 1.3.5 and have selenium-rc, easyb, and spring-security-core plugins installed. Everything seems to work

  • 0

Grails 1.3.5 and have selenium-rc, easyb, and spring-security-core plugins installed. Everything seems to work really well except this one case I’ve run into. I have a page I am testing which has the following markup:

<sec:ifAnyGranted roles='ROLE_ADMIN'>
    <span class="menuButton">
      <g:link mapping="adminPage">
        <g:message code="default.admin.label" default="--Admin--"/>
      </g:link>
    </span>
</sec:ifAnyGranted>

When running the application normally, everything works fine. If I’m logged in as a regular user, the Admin link doesn’t show. If I log in as an admin, the link does show up. When running my test, no matter who is logged in, the check fails, so the Admin link is never rendered.

scenario "An Admin User logs into the system", {
   when "the user completes the login form with proper credentials", {

   grailsApplication = ApplicationHolder.application
   springSecurityService = ApplicationHolder.application.mainContext.getBean("springSecurityService")

   def userAdmin = new User(username: 'testAdmin', firstName: 'Test', lastName: 'Admin', enabled: true, password: springSecurityService.encodePassword("password")).save(flush: true)
   def roleAdmin = new Role(authority: 'ROLE_ADMIN').save(flush: true)
   UserRole.create(userAdmin, roleAdmin)

   selenium.openAndWait("/platform/login/auth")
   selenium.type('j_username', 'testAdmin')
   selenium.type('j_password', 'password')
   selenium.clickAndWait('signInBtn')

 }
 then "the user should be logged in and viewing their My Account page, as an admin", {
   selenium.isTextPresent("Welcome Test").shouldBe true
   selenium.isElementPresent('link=Admin').shouldBe true

 }
}

Other tags work just fine such as ifLoggedIn and ifNotLoggedIn. Anyone know if this is a known issue or any other info on it? Thanks.

  • 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-17T18:07:05+00:00Added an answer on May 17, 2026 at 6:07 pm

    try adding the flush

     UserRole.create(userAdmin, roleAdmin, true)
    

    http://burtbeckwith.github.com/grails-spring-security-core/docs/manual/guide/4%20Required%20and%20Optional%20Domain%20Classes.html#4.2%20Authority%20Class

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

Sidebar

Related Questions

I'm writing a small webapp in Grails and I have the following question regarding
I have not seen much support for Grails to develop facebook apps.I was just
I have a hibernate query in grails Book.findAllByRating(4) In the above query i want
I'm still learning Grails and seem to have hit a stumbling block. Here are
How do I create a grails war file so that it doesn't have the
I'm working now together with others in a grails project. I have to write
Grails vs Rails. Which has better support? And which one is a better choice
Grails makes it very easy to configure datasources for different environments (development, test, production)
I'm using Grails 1.1 beta2. I need to import a large amount of data
I did a grails clean and afterwards when I run via grails run-app the

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.