Quantcast

Spring Security - Check controller access for current user

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Spring Security - Check controller access for current user

mos-7
Hello (especially Burt),

just looking for an elegant way of checking controller access using the Spring Security Core Plugin.

The use case:  Show a list of controllers that the current user has access to.
Something like:  
    grailsApplication.controllerClasses.findAll { controller -> /*  controller is available to users authority   */}

Thanks

Cheers,
Mos
---
http://www.mosbase.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security - Check controller access for current user

mos-7
Any thoughts on this ?


On Thu, May 12, 2011 at 10:56 AM, Mos <[hidden email]> wrote:
Hello (especially Burt),

just looking for an elegant way of checking controller access using the Spring Security Core Plugin.

The use case:  Show a list of controllers that the current user has access to.
Something like:  
    grailsApplication.controllerClasses.findAll { controller -> /*  controller is available to users authority   */}

Thanks

Cheers,
Mos
---
http://www.mosbase.com/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security - Check controller access for current user

burtbeckwith
You can use the sec:access tag for that:

<ul>
   <g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }">
      <sec:access url='${createLink(controller: c.logicalPropertyName, base: "/")}'>
      <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li>
      </sec:access>
   </g:each>
</ul>

Burt

> Any thoughts on this ?
>
>
> On Thu, May 12, 2011 at 10:56 AM, Mos <[hidden email]> wrote:
>
> > Hello (especially Burt),
> >
> > just looking for an elegant way of checking controller access using the
> > Spring Security Core Plugin.
> >
> > The use case:  Show a list of controllers that the current user has access
> > to.
> > Something like:
> >     grailsApplication.controllerClasses.findAll { controller -> /*
> >  controller is available to users authority   */}
> >
> > Thanks
> >
> > Cheers,
> > Mos
> > ---
> > http://www.mosbase.com/
> >
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security - Check controller access for current user

mos-7
Thanks Burt, cool stuff. I should read you docs more carefully. ;) 

Cheers,
Mos
---
http://www.mosbase.com/


On Wed, May 18, 2011 at 11:42 PM, Burt Beckwith <[hidden email]> wrote:
You can use the sec:access tag for that:

<ul>
  <g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }">
     <sec:access url='${createLink(controller: c.logicalPropertyName, base: "/")}'>
     <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li>
     </sec:access>
  </g:each>
</ul>

Burt

> Any thoughts on this ?
>
>
> On Thu, May 12, 2011 at 10:56 AM, Mos <[hidden email]> wrote:
>
> > Hello (especially Burt),
> >
> > just looking for an elegant way of checking controller access using the
> > Spring Security Core Plugin.
> >
> > The use case:  Show a list of controllers that the current user has access
> > to.
> > Something like:
> >     grailsApplication.controllerClasses.findAll { controller -> /*
> >  controller is available to users authority   */}
> >
> > Thanks
> >
> > Cheers,
> > Mos
> > ---
> > http://www.mosbase.com/
> >
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Loading...