'Action method to handle actions from a show view'

@expose('/action/<string:name>/<pk>', methods=['GET'])
def action(self, name, pk):

    if self.appbuilder.sm.has_access(name, self.__class__.__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('.')
