I have been doing permission checking (in my controller) when updating
records something like this (simplified code):
<cfset dataBean =
loadBean(arguments.event.getValue("ID_passed_in_from_form") ) />
<cfif dataBean.getOwner() EQ Session.owner>
then allow things to happen now
<cfelse>
<cfthrow message="Permission denied.... etc." />
</cfif>
The cfthrow is messy, but this is something I don't expect to happen
very often so I'm ok with it. But recently we changed our exception
template so that error messages are not displayed to the user. So now
they get no specific error. I would like to have a nicer looking
error page. I was thinking of changing the cfthrow line to something
like this:
<cfset arguments.event.setValue("errorMessage","Permission
denied... etc.") />
<cfset arguments.event.addResult("niceError") />
But I don't want to have to add a "niceError" result to all my
events. Is there some way to do this globally? Or a better way to do
all this?
Thanks,
-Ryan
--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en