I don't really like this function

a) No doc string
b) If this is for use in the actions like you are using it then we should probably pass `model` as this is passed via the context.  Now this is almost the always the same as we'd get from `import ckan.model as model` but potentially could be different.  We shouldn't break that logic.
c) I'm not sure if it just adds confusion.
d) where it is used only some object types are allowed user and dataset so maybe just a quick bit of inline code might be simpler.
e) I see the point of checking that the object exists for creation but for deletion I'm not sure if this makes sense as cleaning bad data would not be possible.