if (permissions.containsKey(repository.name.toLowerCase())) {
// exact repository permission specified, use it
AccessPermission p = permissions.get(repository.name.toLowerCase());
if (p != null && repository.accessRestriction.isValidPermission(p)) {
ap.permissionType = PermissionType.EXPLICIT;
if (p.atMost(maxPermission)) {
ap.permission = p;
} else {
ap.permission = maxPermission;
}
ap.mutable = true;