implement custom cap/role

phpdoc some classes also