优化
This commit is contained in:
4
website/docs/contribution/_category_.json
Normal file
4
website/docs/contribution/_category_.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Contribution",
|
||||
"position": 90
|
||||
}
|
||||
28
website/docs/contribution/community.md
Normal file
28
website/docs/contribution/community.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
sidebar_position: 99
|
||||
title: Ecology & Community
|
||||
---
|
||||
|
||||
`Tailchat` is a very open platform and welcomes contributions in any form from everyone. Here are some third-party resources related to `Tailchat`
|
||||
|
||||
Feel free submit `pr/issue` to submit your contribution to `Tailchat`, so that we can include it in the following list:
|
||||
|
||||
## Exchange community
|
||||
|
||||
[Join TailchatNightly Channel](https://nightly.paw.msgbyte.com/invite/8Jfm1dWb)
|
||||
|
||||
## Project/Code
|
||||
|
||||
- [Tailchat-Assistant](https://git.povario.com/powermaker450/Tailchat-Assistant): Tailchat Assistant is your very own AI-powered chat bot, ready to implement into your guild!
|
||||
|
||||
|
||||
## Video
|
||||
|
||||
- [【好玩儿的Docker项目】激情畅聊!十分钟搭建一个插件化易拓展的开源即时聊天(IM)应用——Tailchat](https://www.bilibili.com/video/BV1aG411u7M8/)
|
||||
- [简单搭建插件化易拓展的开源即时聊天(IM)应用——Tailchat](https://www.bilibili.com/video/BV1UN4y117M8/)
|
||||
|
||||
## Article
|
||||
|
||||
- [【好玩儿的Docker项目】激情畅聊!十分钟搭建一个插件化易拓展的开源即时聊天(IM)应用——Tailchat](https://blog.laoda.de/archives/docker-compose-install-tailchat)
|
||||
- [Tailchat Synology deployment record](/blog/2023/03/27/deploy-in-synology)
|
||||
- [微信公众号: 重磅推荐:一个开源的即时通讯应用 Tailchat(from GitHub黑板报)](https://mp.weixin.qq.com/s/uImzeb_EQdQcm9LGGwGYuw)
|
||||
4
website/docs/contribution/dev/_category_.json
Normal file
4
website/docs/contribution/dev/_category_.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Development Documentation",
|
||||
"position": 2
|
||||
}
|
||||
76
website/docs/contribution/dev/role.md
Normal file
76
website/docs/contribution/dev/role.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
title: Identity Groups and Permissions
|
||||
---
|
||||
|
||||
Identity groups are a form of dividing user authority points in group management (RBAC).
|
||||
|
||||
An identity group is composed of a series of permission point switches, and a user may be composed of multiple identity groups. For example, identity group A has A permission, and identity group B has B permission. User C in group A and identity group B has permission A and permission B. In order to simplify the design of permissions, permission points are implemented through simple `true/false`
|
||||
|
||||
More about `RBAC` can be found in the related wiki: https://en.wikipedia.org/wiki/Role-based_access_control I won’t go into details here.
|
||||
|
||||
The following mainly talks about how to add/modify permission points in `Tailchat`
|
||||
|
||||
|
||||
## Built-in permissions
|
||||
|
||||
Permission points need to be declared on both the front-end and back-end at the same time. The front-end is responsible for the display of the front-end, and the back-end is responsible for the comprehensive permission verification. If there is no permission, the processing interface should directly throw an error.
|
||||
|
||||
### Frontend Management
|
||||
|
||||
The permission point list of the front end is maintained in `client/shared/utils/role-helper.ts`, including the permission point of the permission point, such as:
|
||||
|
||||
|
||||
```tsx
|
||||
export const PERMISSION = {
|
||||
/**
|
||||
* Non-plugin permission points are called core
|
||||
*/
|
||||
core: {
|
||||
message: 'core.message',
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
And the display of the permission point on the management page:
|
||||
|
||||
```tsx
|
||||
export const getPermissionList = (): PermissionItemType[] => [
|
||||
{
|
||||
key: PERMISSION.core.message,
|
||||
title: t('Send Message'),
|
||||
desc: t('Allow members to send messages in text channel'),
|
||||
default: true,
|
||||
}
|
||||
];
|
||||
```
|
||||
|
||||
The way to use it is to obtain the permission points maintained under the group through hooks:
|
||||
|
||||
```tsx
|
||||
const [allowSendMessage] = useHasGroupPermission(groupId, [
|
||||
PERMISSION.core.message,
|
||||
]);
|
||||
```
|
||||
|
||||
The way of using arrays is convenient for some business logics that need to have multiple permission points.
|
||||
|
||||
|
||||
### Backend
|
||||
|
||||
The permission statement of the backend is maintained in `server/packages/sdk/src/services/lib/role.ts`, and the usage method is very simple. as follows:
|
||||
```ts
|
||||
const [hasPermission] = await call(ctx).checkUserPermissions(
|
||||
groupId,
|
||||
userId,
|
||||
[PERMISSION.core.message]
|
||||
);
|
||||
if (!hasPermission) {
|
||||
throw new NoPermissionError(t('no operation permission'));
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Plugin permissions
|
||||
|
||||
TODO
|
||||
64
website/docs/contribution/guide.md
Normal file
64
website/docs/contribution/guide.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
title: Contribution Guidelines
|
||||
---
|
||||
|
||||
`Tailchat` is a very open project and welcomes contributions of any kind from all backgrounds. Its plugin architecture is meant to allow `Tailchat` to host the implementation of any idea.
|
||||
|
||||
We hope that `Tailchat` is not just a simple chat application, but a space to connect different tools and different ideas.
|
||||
|
||||
Github link: https://github.com/msgbyte/tailchat
|
||||
|
||||
-----------
|
||||
|
||||
Contributor roles are currently urgently needed for `Tailchat`:
|
||||
|
||||
|
||||
### Front-end plugin developer
|
||||
|
||||
- Familiar with the use of React
|
||||
- Possess certain abstract thinking
|
||||
- Have basic aesthetic ability
|
||||
- Passionate about open source projects
|
||||
|
||||
### Backend plugin developers
|
||||
|
||||
- Familiar with the use of Nodejs
|
||||
- Have a basic understanding of microservices
|
||||
- Passionate about open source projects
|
||||
|
||||
### electron application developer
|
||||
|
||||
- Understand cross-platform development
|
||||
- Familiar with code injection, able to realize data interaction between render process and main
|
||||
- Passionate about open source projects
|
||||
|
||||
### React Native App Developers
|
||||
|
||||
- Familiar with the development of React Native applications
|
||||
- Familiar with the use of React Native Web
|
||||
- Passionate about open source projects
|
||||
|
||||
### Operation Classmates
|
||||
|
||||
- Understand basic operational capabilities and have experience as a group leader
|
||||
- Understand the publicity channels and methods of open source projects
|
||||
- Strong communication skills
|
||||
- Passionate about open source projects
|
||||
|
||||
### Ambassador
|
||||
|
||||
- Master the mother tongue and English (if English is the mother tongue, only English is enough)
|
||||
- Have a certain understanding of the open source community
|
||||
- Participate in the development of Tailchat usage and best practices
|
||||
- Strong communication skills
|
||||
- Passionate about open source projects
|
||||
|
||||
### other
|
||||
|
||||
More of all possibilities...
|
||||
|
||||
|
||||
:::info
|
||||
Contact: Send an email to `moonrailgun@gmail.com` or [Join TailchatNightly Channel](https://nightly.paw.msgbyte.com/invite/8Jfm1dWb)
|
||||
:::
|
||||
Reference in New Issue
Block a user