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 have a grails app that uses the Spring-Security-Core plugin, which integrates Spring Security
I have a grails site (grails 2.0 with spring security 1.2.6) login that's supposed
I have a grails vaadin project. the auto recompilation feature used to work well
I am trying to have Weceem (Grails CMS) installed locally on my machine (Windows
I have a grails 2.0 app which I have installed the resources plugin into,
I have a grails 1.3.7 application. I am making use of Spring's JMS classses
Does Grails have any plugins with functionality similar to the django-debug-toolbar (djdt)? See this
Grails have cofig for spring bean called resources.groovy . And as i understand from
I have a grails app developed under version 1.3.7It works very well when I
The select form component in grails can have the form: <g:select name=user.age from=${0..59} value=${age}

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.