I am currently programming an assignment type plugin, which needs some custom capabilities. I struggled with setting these up, until I realized that Moodle tries to pick up my "access.php" file in the wrong directory location.
Suppose that my plugin is called "myplugin".
Capabilities are read from $CFG->dirroot/mod/assignment/type/myplugin/db/access.php
Capabilities are read from $CFG->dirroot/assignment_type/myplugin/db/access.php
The root problem seems to lie in lib/accesslib.php, function load_capability_def() . Probably the path name will need to be passed explicitly as a parameter here. So far, the procedure is called with "assignment_type/myplugin" as the parameter value.