code: def before_render(self):
          
          # We want to display the nav tabs, so we do NOT want disable_border in
          # the request. Thus, do not call super.before_render
  
          mtool = api.get_tool("portal_membership")
          if not mtool.checkPermission(AddAnalysisSpec, self.context):
              del self.context_actions[_("Add")]
docs: Before template render hook