{"id":3477,"date":"2011-04-06T16:16:05","date_gmt":"2011-04-06T10:46:05","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=3477"},"modified":"2016-12-16T13:01:19","modified_gmt":"2016-12-16T07:31:19","slug":"handling-instance-based-security","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/","title":{"rendered":"Handling Instance Based Security"},"content":{"rendered":"<p>In my current project, we were required to implement <strong>Instance Based Security<\/strong>. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the <strong>Spring Security Plugin<\/strong> to use the <strong>Annotations<\/strong> to do our job. All we wanted to do was to develop annotations for actions, which could help to decide what type of access verification needs to be done on a particular request, inside some Filter. So we proceeded like this:<\/p>\n<p>We created an Abstract Class from which our <strong>User<\/strong> domain Class extended. All our Access Verifying functions would remain in this class. The class provides a single entry function (by the name <strong>evaluateExpression<\/strong>) to all other Access Verifying functions. This helped us to keep the Filter class clean. The Class looks like:<\/p>\n<p>[java]<br \/>\nabstract class MyAppSecure {<\/p>\n<p>  public Boolean evaluateExpression(String methodName, Map params = [:]) {<br \/>\n    this.&quot;$methodName&quot;(params.id?.toLong())<br \/>\n  }<\/p>\n<p>  \/\/ One of the many functions to be used to verify valid access<br \/>\n  public Boolean hasUserAccessById(Long id) {<br \/>\n    return id ? (this.id == id.toLong()) : true<br \/>\n  }<\/p>\n<p>}<br \/>\n[\/java]<\/p>\n<p>So our User domain class looks like:<\/p>\n<p>[java]<br \/>\nclass User extends MyAppSecure {<\/p>\n<p>}<br \/>\n[\/java]<\/p>\n<p>Now, the idea is to:<\/p>\n<ol>\n<li>Intercept a request in the filter.<\/li>\n<li>Get the annotation expression placed on top of the respective Controller Action. (The expression(s) would be name of the <strong>MyAppSecure<\/strong> method(s) used to verify the access)<\/li>\n<li>Call a corresponding method in <strong>MyAppSecure<\/strong> to verify access<\/li>\n<li>Take appropriate action corresponding to a result<\/li>\n<\/ol>\n<p>So let us delve into the implementation:<\/p>\n<p>First step would be to enable the annotations. To do this create an interface in src\/java (or you can do it in src\/groovy as well):<\/p>\n<p>[java]<br \/>\n@Documented<br \/>\n@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})<br \/>\n@Retention(RetentionPolicy.RUNTIME)<br \/>\npublic @interface MySecured {<br \/>\n    String[] expressions();<br \/>\n}<br \/>\n[\/java]<\/p>\n<p>Now we are good to go for using annotations. Let us assume an action <strong>edit<\/strong> inside <strong>AccountController<\/strong>:<\/p>\n<p>[java]<br \/>\nclass AccountController{<\/p>\n<p>@MySecured(expressions = [&quot;hasUserAccessToAccount&quot;])<br \/>\n def edit = {<br \/>\n    User user = params.id ? User.get(params.id) : user<br \/>\n    render(view: &quot;edit&quot;, model: [user: user])<br \/>\n  }<br \/>\n}<\/p>\n<p>[\/java]<\/p>\n<p><strong>Note<\/strong>: We can also give multiple expressions (to evaluate multiple access rules), separated by\u00a0commas inside the list.<\/p>\n<p>Now we need to implement a method by the name <strong>hasUserAccessToAccount<\/strong> in MyAppSecure:<\/p>\n<p>[java]<br \/>\nabstract class MyAppSecure {<\/p>\n<p>public Boolean evaluateExpression(String methodName, Map params = [:]) {<br \/>\n    this.&quot;$methodName&quot;(params)<br \/>\n}<\/p>\n<p>public Boolean hasUserAccessToAccount(Map params) {<br \/>\n\/\/ SAMPLE LOGIC.<br \/>\n    Integer count = Account.createCriteria().get {<br \/>\n      projections {<br \/>\n        count(&quot;id&quot;)<br \/>\n      }<br \/>\n      eq(&#8216;id&#8217;, params.id.toLong())<br \/>\n      eq(&#8216;user&#8217;, this)<br \/>\n    }<br \/>\n    return (count &gt; 0)<br \/>\n  }<br \/>\n }<br \/>\n}<\/p>\n<p>[\/java]<\/p>\n<p>We would also need some logic to get and parse annotations in <strong>MyAppSecure<\/strong>. We wrote something like this:<\/p>\n<p>[java]<br \/>\npublic Boolean hasAccess(Class controllerClazz, String actionName,  Map params) { def field = controllerClazz.declaredFields.find {it.toString().indexOf(controllerClazz.name + &#8216;.&#8217; + actionName) != -1}<br \/>\n \/\/ get the annotation on a Controller action (account\/edit in our case)<br \/>\n    def securedAnnotation = field.getAnnotation(AdlSecured)<br \/>\n    return (securedAnnotation ? this.evaluateEveryExpression (params, securedAnnotation)<br \/>\n  }<\/p>\n<p> \/\/ Evaluate every expression and combine the result using AND (or we can use OR as well)<br \/>\n  private Boolean evaluateEveryExpression(Map params, def securedAnnotation) {<br \/>\n    Boolean hasAccess = securedAnnotation.expressions().every {String securedExpression -&gt;<br \/>\n      this.hasAccessForExpression(securedExpression, params)<br \/>\n    }<br \/>\n    return hasAccess<br \/>\n  }<\/p>\n<p>  \/\/Evaluate expression<br \/>\n  private Boolean hasAccessForExpression(String expressionToBeEvaluated, Map params) {<br \/>\n    return this.evaluateExpression(expressionToBeEvaluated, params)<br \/>\n  }<\/p>\n<p>[\/java]<\/p>\n<p>Now in you <strong>Filter<\/strong> you can write something like this:<\/p>\n<p>[java]<br \/>\nmySecureFilter(controller: &quot;*&quot;, action: &quot;*&quot;) {<br \/>\n      before = {<br \/>\n          User user = someSecurityService.currentUser<br \/>\n          if (user) {<br \/>\n          \/\/ gets the controller class for a controllerName<br \/>\n            Class controllerClazz = getControllerClass(controllerName)<\/p>\n<p>            if (!user.hasAccess(controllerClazz, actionName, params)) {<br \/>\n                redirect(controller: &#8216;accessController&#8217;, action: &#8216;unauthorized&#8217;)<br \/>\n                }<br \/>\n              }<br \/>\n              return false<br \/>\n            }<br \/>\n          }<br \/>\n[\/java]<\/p>\n<p>That is all that we need to do. I hope you would find this useful. Any suggestions will be welcomed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10,"footnotes":""},"categories":[7],"tags":[521,4840,227,9],"class_list":["post-3477","post","type-post","status-publish","format-standard","hentry","category-grails","tag-custom-security","tag-grails","tag-grail-security","tag-groovy"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Imran Mir\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Handling Instance Based Security | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Handling Instance Based Security | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#article\",\"name\":\"Handling Instance Based Security | TO THE NEW Blog\",\"headline\":\"Handling Instance Based Security\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/imran\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2011-04-06T16:16:05+05:30\",\"dateModified\":\"2016-12-16T13:01:19+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":4,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#webpage\"},\"articleSection\":\"Grails, Custom Security, Grails, Grails Security, Groovy\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#listItem\",\"name\":\"Handling Instance Based Security\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#listItem\",\"position\":3,\"name\":\"Handling Instance Based Security\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/imran\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/imran\\\/\",\"name\":\"Imran Mir\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/186fa1c29a61225f60e52068be3f954d58ffa64750eac981d45154a72275b1eb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Imran Mir\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/\",\"name\":\"Handling Instance Based Security | TO THE NEW Blog\",\"description\":\"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/handling-instance-based-security\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/imran\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/imran\\\/#author\"},\"datePublished\":\"2011-04-06T16:16:05+05:30\",\"dateModified\":\"2016-12-16T13:01:19+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Handling Instance Based Security | TO THE NEW Blog","description":"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations","canonical_url":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#article","name":"Handling Instance Based Security | TO THE NEW Blog","headline":"Handling Instance Based Security","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/imran\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"datePublished":"2011-04-06T16:16:05+05:30","dateModified":"2016-12-16T13:01:19+05:30","inLanguage":"en-US","commentCount":4,"mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#webpage"},"articleSection":"Grails, Custom Security, Grails, Grails Security, Groovy"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/tothenewco.pro\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#listItem","name":"Handling Instance Based Security"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#listItem","position":3,"name":"Handling Instance Based Security","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/imran\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/imran\/","name":"Imran Mir","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/186fa1c29a61225f60e52068be3f954d58ffa64750eac981d45154a72275b1eb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Imran Mir"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/","name":"Handling Instance Based Security | TO THE NEW Blog","description":"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/imran\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/imran\/#author"},"datePublished":"2011-04-06T16:16:05+05:30","dateModified":"2016-12-16T13:01:19+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Handling Instance Based Security | TO THE NEW Blog","og:description":"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations","og:url":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Handling Instance Based Security | TO THE NEW Blog","twitter:description":"In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"3477","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 21:27:41","updated":"2024-02-29 09:32:21","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHandling Instance Based Security\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Grails","link":"https:\/\/tothenewco.pro\/blog\/category\/grails\/"},{"label":"Handling Instance Based Security","link":"https:\/\/tothenewco.pro\/blog\/handling-instance-based-security\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/3477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=3477"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/3477\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=3477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=3477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=3477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}