Git Product home page Git Product logo

Comments (8)

marvinthepa avatar marvinthepa commented on August 12, 2024 1

@ddelponte:

to reproduce this with your example, you have to add a toString method that may return null, as mentioned in #56 (comment):

diff --git a/grails-app/domain/com/testapp/User.groovy b/grails-app/domain/com/testapp/User.groovy
index aacd5d0..235d48c 100644
--- a/grails-app/domain/com/testapp/User.groovy
+++ b/grails-app/domain/com/testapp/User.groovy
@@ -52,4 +52,9 @@ class User implements Serializable {
    static mapping = {
        password column: '`password`'
    }
+
+   @Override
+   public String toString() {
+       return username
+   }
 }

from grails-spring-security-ui.

marvinthepa avatar marvinthepa commented on August 12, 2024

By major coincidence, I ran into the exact same issue with the exact same versions of grails and the two plugins today. @mickdavis: I feel your pain.

from grails-spring-security-ui.

marvinthepa avatar marvinthepa commented on August 12, 2024

I think I found the issue. Spring-security-ui does not like it when the "Person" and "Role" domain objects (see http://grails-plugins.github.io/grails-spring-security-core/v2/guide/domainClasses.html#personClass) return null in their "toString" methods.

So my solution was to change

    String toString() {
        return this.username
    }

to

    String toString() {
        return this.username ?: 'Person without username'
    }

(this is for the Person class, but I had to update the Role class accordingly).

from grails-spring-security-ui.

marvinthepa avatar marvinthepa commented on August 12, 2024

Btw. I think the issue is still a bug in spring-security-ui, I will probably create a pull request soon.

from grails-spring-security-ui.

mgkimsal avatar mgkimsal commented on August 12, 2024

@marvinthepa - your patch - can't get it working.

Can't get an override - I'll need to rebuild the entire plugin and use that one from a local repo vs just being able to override it somehow?

Was also trying to get my subclassed usercontroller to work in a namespace, but if the namespace is different from the parent class, that seems like it won't work either... (or would it?)

(the toString() stuff didn't work for me, unfortunately)

Thanks for your potential patch :)

from grails-spring-security-ui.

marvinthepa avatar marvinthepa commented on August 12, 2024

@mgkimsal: I don't know if you can override taglibs. Building the plugin yourself from source will definitely work.

If fixing your toString in your person and role domain objects didn't help, I suspect you are experiencing a different problem. I might be able to tell if you share the stacktrace that you see.

from grails-spring-security-ui.

ddelponte avatar ddelponte commented on August 12, 2024

@mickdavis @marvinthepa
I have been unable to reproduce this issue with:

compile "org.grails.plugins:spring-security-core:2.0.0"
compile "org.grails.plugins:spring-security-ui:1.0-RC3"

using grails-2.5.6 and java 8u144-zulu

Here's a link to a video demonstrating it working:
https://goo.gl/jCpiQS

and here's the test app I created:
security-ui_issue-56.zip

Are you able to provide a test app which reproduces the issue?

Thanks!

from grails-spring-security-ui.

sdelamo avatar sdelamo commented on August 12, 2024

Thanks @ddelponte for fixing this

from grails-spring-security-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.