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 8541693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:53:19+00:00 2026-06-11T11:53:19+00:00

I am on Grails 2.1.1 and Spring Security Core Plugin 1.2.7.3 . I am

  • 0

I am on Grails 2.1.1 and Spring Security Core Plugin 1.2.7.3.

I am trying to assign Roles to Users in BootStrap.groovy and persist these assignments. I create my Roles and an Admin User in BootStrap.

I found the following blog post: Create User Roles for Spring Security

When I try this approach, I get:

2012-09-16 22:00:56,762 ERROR [org.codehaus.groovy.grails.web.context.GrailsContextLoader] Error executing bootstraps:

groovy.lang.MissingMethodException: No signature of method: User.addToAuthorities() is applicable for argument types: (Role) values: Possible solutions: getAuthorities()

I also tried

class BootStrap {

    def init = { servletContext ->
        ....
        admin.getAuthorities().add(adminRole) 
        admin.save(flush: true)
        ....
    }
} 

However, when I checked the user_role table, it was empty (I checked and entries for Admin User and Admin Role were in respective user and role tables, just not the association).

Could anyone please provide me some guidance or insight on what I am doing wrong? Thank you very much.

  • 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-06-11T11:53:20+00:00Added an answer on June 11, 2026 at 11:53 am

    That blog post is 3 years old and wrong for the current plugin in two ways. One, don’t encode the password, it’s done for you in the User class. And two (the problem you’re seeing now) don’t call collections methods (addTo, removeFrom) because collections aren’t used. Call UserRole.create admin, adminRole as described in the plugin docs: http://grails-plugins.github.com/grails-spring-security-core/docs/manual/index.html (in particular the tutorial in section 23.1).

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

Sidebar

Related Questions

I'm using the Spring Security Plugin in Grails 2.0.3, and am trying to add
I am using the spring-security-core plugin in my grails app. I need to know
I'm using Grails Spring Security Core plugin and I need to perform a few
I'm trying to use the latest spring security plugin for grails, but I've hit
I have a grails app that uses the Spring-Security-Core plugin, which integrates Spring Security
I'm developing a Grails (Version 1.3.3) Web-Application using the Grails Spring-Security Plugin, Spring-Security-Core-1.0.1 (which,
Note I am using Grails 2.0.4 and spring security core plugin 1.2.7.2 This appears
I am new to grails. I am using grails 1.3.7, and spring security core
Does the Spring Security plugin for Grails support automatically locking an account after X
I am running grails plugin for Spring Social from https://github.com/synergyj/grails-spring-social-core When I tried 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.