resource: Fix access control to attachments.

To Achieve this, AccessControl had to be changed as belows.
* Rename Resource to ResourceType.
* Unify GlobalResource and ProjectResource into Resource.
* Add getContainer() to Resource.