views:

77

answers:

2

Hi

I have one grails application.In that I have one model class named Book. From any controller if I am calling Book.list(), Book.get(id) and some other hibernate calls like save() I want to authorize using current login user role. If authorization fails i have to throw some error. Is there any plugin available for this. Please give me some idea or suggestion.

A: 

take a look at: http://www.grails.org/Controllers+-+Interceptors

Ray Tayek
A: 

We can use the following interceptors in domain classes.Using this we can handle easily

 def onLoad={

    }

  def beforeInsert={

  }

   def beforeDelete={

  }

   def beforeUpdate={

   }
BlackPanther