Modified default library, and refactor repo access permission checking