开发者

Interrupting grails dynamic methods

开发者 https://www.devze.com 2022-12-20 16:06 出处:网络
I have one grails application.I开发者_开发知识库n 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 wan

I have one grails application.I开发者_开发知识库n 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.


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


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

 def onLoad={

    }

  def beforeInsert={

  }

   def beforeDelete={

  }

   def beforeUpdate={

   }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号