Skip to content

Commit

Permalink
perf: improve s3link role permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
longjuan committed Oct 19, 2023
1 parent 7311295 commit 966445b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "com.github.node-gradle.node" version "5.0.0"
id "io.freefair.lombok" version "8.0.1"
id "run.halo.plugin.devtools" version "0.0.6"
id "run.halo.plugin.devtools" version "0.0.7"
}

group 'run.halo.s3os'
Expand All @@ -16,7 +16,7 @@ repositories {
}

dependencies {
implementation platform('run.halo.tools.platform:plugin:2.9.0-SNAPSHOT')
implementation platform('run.halo.tools.platform:plugin:2.10.0-SNAPSHOT')
compileOnly 'run.halo.app:api'

implementation platform('software.amazon.awssdk:bom:2.19.8')
Expand All @@ -33,7 +33,7 @@ configurations.runtimeClasspath {


halo {
version = '2.9.0'
version = '2.10.0'
}

haloPlugin {
Expand Down
6 changes: 3 additions & 3 deletions console/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {definePlugin} from "@halo-dev/console-shared";
import type {PluginTab} from "@halo-dev/console-shared";
import HomeView from "./views/HomeView.vue";
import S3Link from "./views/S3Link.vue";
import {markRaw} from "vue";

export default definePlugin({
Expand All @@ -12,8 +12,8 @@ export default definePlugin({
{
id: "s3-link",
label: "关联S3文件",
component: markRaw(HomeView),
permissions: []
component: markRaw(S3Link),
permissions: ["plugin:s3os:link"]
},
];
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main/resources/console/main.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/main/resources/extensions/s3os-role-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1alpha1
kind: "Role"
metadata:
name: role-template-s3os-link
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/dependencies: |
[ "role-template-manage-attachments", "role-template-view-plugins" ]
rbac.authorization.halo.run/module: "S3 Attachments Management"
rbac.authorization.halo.run/display-name: "S3 Link"
rbac.authorization.halo.run/ui-permissions: |
["plugin:s3os:link"]
rules:
- apiGroups: [ "s3os.halo.run" ]
resources: [ "policies" ]
resourceNames: [ "s3" ]
verbs: [ "get", "list" ]
- apiGroups: [ "s3os.halo.run" ]
resources: [ "objects" ]
verbs: [ "get", "list" ]
- nonResourceURLs: ["/apis/s3os.halo.run/v1alpha1/attachments/link"]
verbs: [ "create" ]

0 comments on commit 966445b

Please sign in to comment.