zotonic/zotonic — pull request #464 by kaos (2012-11-21 15:40:25+00:00)
Title: core: restructure and improve acl routines (issue #463).

I'd like this reviewed before I commit it (for issue #463):

It started off with adding a guard to z_acl:wm_is_authorized/2.
Along with that I wanted to add some -spec's for that family of functions,
which led to adding -type's in webzmachine and m_rsc.

Also, it felt backwards to require the id to be integer at this stage,
which turned out to affect the acl modules handling the authorization.

Also, m_rsc:get_acl_props/2 always returns a #acl_props{} record when
given a integer id, even if no resource with that id exists, so to be
consistent I updated it so that also applies when presented with a
resource name.

This is a rather big chunk of changes in one commit, but they are rather
entangled, at least when applied in the order I made them.