@@ -16,6 +16,7 @@ import io.ktor.utils.io.charsets.Charsets
1616import kotlinx.html.FlowContent
1717import kotlinx.html.FlowOrInteractiveOrPhrasingContent
1818import kotlinx.html.HTML
19+ import kotlinx.html.HTMLTag
1920import kotlinx.html.a
2021import kotlinx.html.button
2122import kotlinx.html.h1
@@ -26,6 +27,8 @@ import kotlinx.html.p
2627import kotlinx.html.script
2728import kotlinx.html.span
2829import kotlinx.html.stream.createHTML
30+ import kotlinx.html.style
31+ import kotlinx.html.svg
2932import kotlinx.html.table
3033import kotlinx.html.tbody
3134import kotlinx.html.td
@@ -34,6 +37,7 @@ import kotlinx.html.thead
3437import kotlinx.html.title
3538import kotlinx.html.tr
3639import kotlinx.html.unsafe
40+ import kotlinx.html.visit
3741import org.modelix.authorization.hasPermission
3842import org.modelix.authorization.requiresLogin
3943import org.modelix.model.lazy.RepositoryId
@@ -112,7 +116,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
112116 }
113117 th { + " Branch" }
114118 th {
115- colSpan = " 3 "
119+ colSpan = " 4 "
116120 + " Actions"
117121 }
118122 }
@@ -125,6 +129,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
125129 td {
126130 rowSpan = repoRowSpan
127131 + repository.id
132+ buildPermissionManagementLink(repository.id, null )
128133 }
129134 td {
130135 rowSpan = repoRowSpan
@@ -145,6 +150,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
145150 span {
146151 + branch.branchName
147152 }
153+ buildPermissionManagementLink(repository.id, branch.branchName)
148154 }
149155 td {
150156 buildHistoryLink(repository.id, branch.branchName)
@@ -177,6 +183,19 @@ internal fun FlowOrInteractiveOrPhrasingContent.buildExploreLatestLink(repositor
177183 }
178184}
179185
186+ internal fun FlowOrInteractiveOrPhrasingContent.buildPermissionManagementLink (repositoryId : String , branchName : String? ) {
187+ val resourceId = ModelServerPermissionSchema .repository(repositoryId)
188+ .let { if (branchName == null ) it.resource else it.branch(branchName).resource }
189+ .fullId
190+ a(" ../permissions/resources/${resourceId.encodeURLPathPart()} /" ) {
191+ svg {
192+ style = " color: rgba(0, 0, 0, 0.87); fill: rgba(0, 0, 0, 0.87); width: 20px; height: 20px;"
193+ attributes[" viewBox" ] = " 0 0 24 24"
194+ HTMLTag (" path" , consumer, mapOf (" d" to " M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z" ), null , false , false ).visit {}
195+ }
196+ }
197+ }
198+
180199internal fun FlowContent.buildDeleteRepositoryForm (repositoryId : String ) {
181200 button {
182201 name = " delete"
0 commit comments