def action(self, name, pk):
        """
        Action method to handle actions from a show view
        """
        # Maintains compatibility but refuses to proceed if CSRF is enabled
        if not self.is_get_mutation_allowed():
            self.update_redirect()
            log.warning("CSRF is enabled and a action using GET was invoked")
            flash(as_unicode(FLAMSG_ERR_SEC_ACCESS_DENIED), "danger")
            return redirect(self.get_redirect())

        pk = self._deserialize_pk_if_composite(pk)
        permission_name = self.get_action_permission_name(name)
        if self.appbuilder.sm.has_access(permission_name, self.class_permission_name):
            action = self.actions.get(name)
            return action.func(self.datamodel.get(pk))
        else:
            flash(as_unicode(FLAMSG_ERR_SEC_ACCESS_DENIED), "danger")
            return redirect(".")

        Action method to handle actions from a show view
        
flask_appbuilder/views.py