Friend roles stored in a database table

2013-11-17 Thread wm . mark . lee
Hello, As a long-time Java web developer, I've now been doing clojure for a few days so there's a lot I don't get yet, but I do have an end-to-end working Compojure web application with a UI, JSON web services, and working form-based authentication using Friend - originally using the in-memory

Re: Friend roles stored in a database table

2013-11-17 Thread Dave Della Costa
Sounds like you've got some of this working smoothly already, so apologies in advance if any of this is redundant. Regarding database roles, the way I have it working in one of my simpler apps with the default interactive form workflow is to set the credential-fn in the workflow configuration to

Re: Friend roles stored in a database table

2013-11-17 Thread wm . mark . lee
Hello, some inline-comments... On Sunday, 17 November 2013 11:25:38 UTC, David Della Costa wrote: As far as actually storing the roles in the database, they are simply a stringified set of namespace-qualified keywords, like so: #{:my-app-ns/user} #{:my-app-ns/admin

Re: Friend roles stored in a database table

2013-11-17 Thread wm . mark . lee
Sometimes you can't see the wood for the trees I guess, I have it working with this trivial change: (defn credential-fn [username] (update-in (read-user username) [:roles] read-string)) Still learning the basics... On Sunday, 17 November 2013 17:04:27 UTC, wm.ma...@gmail.com wrote:

Re: Friend roles stored in a database table

2013-11-17 Thread Dave Della Costa
Heh--I know exactly what you mean, had the exact same kind of experience myself many times. In any case, glad you got it working! (2013/11/18 4:42), wm.mark@gmail.com wrote: Sometimes you can't see the wood for the trees I guess, I have it working with this trivial change: (defn