Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add role templates for posts in user center #4965

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@ metadata:
labels:
rbac.authorization.halo.run/system-reserved: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "编辑者"
rbac.authorization.halo.run/dependencies: |
["role-template-manage-posts", "post-author"]
["role-template-post-editor"]
rules: [ ]

---
apiVersion: v1alpha1
kind: "Role"
metadata:
name: role-template-post-editor
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "Post Editor"
rbac.authorization.halo.run/dependencies: |
["role-template-manage-posts", "role-template-post-author"]
rules: [ ]

---
Expand All @@ -20,13 +34,27 @@ metadata:
labels:
rbac.authorization.halo.run/system-reserved: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "作者"
rbac.authorization.halo.run/disallow-access-console: "true"
rbac.authorization.halo.run/redirect-on-login: "/uc"
rbac.authorization.halo.run/dependencies: |
[ "post-contributor", "post-publisher" ]
[ "role-template-post-author" ]
rules: [ ]

---
apiVersion: v1alpha1
kind: "Role"
metadata:
name: role-template-post-author
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "Post Author"
rbac.authorization.halo.run/dependencies: |
[ "role-template-post-contributor", "role-template-post-publisher", "role-template-post-attachment-manager" ]
rules: [ ]

---
Expand All @@ -37,11 +65,25 @@ metadata:
labels:
rbac.authorization.halo.run/system-reserved: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "投稿者"
rbac.authorization.halo.run/disallow-access-console: "true"
rbac.authorization.halo.run/redirect-on-login: "/uc"
rbac.authorization.halo.run/dependencies: |
[ "role-template-post-contributor" ]
rules: [ ]

---
apiVersion: v1alpha1
kind: "Role"
metadata:
name: role-template-post-contributor
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
# Currently, yaml definition does not support i18n, please see https://github.com/halo-dev/halo/issues/3573
rbac.authorization.halo.run/display-name: "Post Contributor"
rbac.authorization.halo.run/dependencies: |
[ "role-template-view-categories", "role-template-view-tags" ]
rbac.authorization.halo.run/ui-permissions: |
Expand All @@ -58,7 +100,7 @@ rules:
apiVersion: v1alpha1
kind: Role
metadata:
name: post-publisher
name: role-template-post-publisher
labels:
halo.run/role-template: "true"
annotations:
Expand All @@ -70,18 +112,17 @@ rules:
- apiGroups: [ "uc.api.content.halo.run" ]
resources: [ "posts/publish", "posts/unpublish" ]
verbs: [ "update" ]

---
apiVersion: v1alpha1
kind: Role
metadata:
name: post-attachment-manager
name: role-template-post-attachment-manager
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/module: "Posts Management"
rbac.authorization.halo.run/display-name: "Post Attachment Manager"
rbac.authorization.halo.run/dependencies: |
[ "role-template-post-attachment-viewer" ]
rbac.authorization.halo.run/ui-permissions: |
[ "uc:attachments:manage" ]
rules:
Expand Down
6 changes: 3 additions & 3 deletions console/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,9 +1345,9 @@ core:
Notification Configuration: Notification Configuration
Configure Notifier: Configure Notifier
Post Attachment Manager: Allow images to be uploaded in posts
Post Author: Author
Post Contributor: Contributor
Post Editor: Editor
Post Author: Contributions allowed
Post Contributor: Allows you to manage your own posts
Post Editor: Allow management of all posts
Post Publisher: Allow to publish own posts
components:
submit_button:
Expand Down
6 changes: 3 additions & 3 deletions console/src/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,9 @@ core:
Cache Manage: 缓存管理
Notification Configuration: 通知配置
Configure Notifier: 配置通知器
Post Editor: 编辑者
Post Contributor: 投稿者
Post Author: 作者
Post Editor: 允许管理所有文章
Post Contributor: 允许管理自己的文章
Post Author: 允许投稿
Post Attachment Manager: 允许在文章中上传图片
Post Publisher: 允许发布自己的文章
components:
Expand Down
6 changes: 3 additions & 3 deletions console/src/locales/zh-TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,9 @@ core:
Configure Notifier: 配置通知器
Notification Configuration: 通知配置
Post Attachment Manager: 允許在文章中上傳圖片
Post Author: 作者
Post Contributor: 投稿者
Post Editor: 編輯者
Post Author: 允许管理自己的文章
Post Contributor: 允许投稿
Post Editor: 允许管理所有文章
Post Publisher: 允許發布自己的文章
components:
submit_button:
Expand Down
Loading