fun getHooksAccessType()

in src/main/kotlin/org/jetbrains/teamcity/github/TokensHelper.kt [27:34]


        fun getHooksAccessType(scopes: List<String>): Pair<HookAccessType, RepoAccessType> {
            if (scopes.contains("public_repo")) return HookAccessType.ADMIN to RepoAccessType.PublicOnly
            if (scopes.contains("repo")) return HookAccessType.ADMIN to RepoAccessType.All
            if (scopes.contains("admin:repo_hook")) return HookAccessType.ADMIN to RepoAccessType.All
            if (scopes.contains("write:repo_hook")) return HookAccessType.WRITE to RepoAccessType.All
            if (scopes.contains("read:repo_hook")) return HookAccessType.READ to RepoAccessType.All
            return HookAccessType.NO_ACCESS to RepoAccessType.All
        }