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

[Proposal] Support team feature #1629

Closed
3 tasks done
1996fanrui opened this issue Sep 17, 2022 · 6 comments
Closed
3 tasks done

[Proposal] Support team feature #1629

1996fanrui opened this issue Sep 17, 2022 · 6 comments
Assignees
Labels

Comments

@1996fanrui
Copy link
Member

1996fanrui commented Sep 17, 2022

Code of Conduct

Task list

Search before asking

  • I had searched in the issues and found no similar issues.

Describe the proposal

Background:

Currently, StreamPark doesn't support team, so all projects and applications will be showed in the same pages. For some companies, there are too many departments or teams. For ease of use and security, they shouldn't view the applicaton list of other teams.

Solution

Support the team feature, the team as the workspace in the WebUI.

User needs to choose a team first.

image

The relationship between app, project and team

  • Each project can only belong to one team.
  • Each app can only belong to one team.
  • The front end only shows a list of projects and apps for the current team.
  • The app or project is created by default also belong to the current team.

Database table: t_flink_app and t_flink_project, they're old tables, we need to add the new filed team_id. These 2 tables need to add index for team_id, because WebUI usually query app or project list by teamId.

image

image

Team management

Create/Modify/Delete/View team information.

Database table: t_team, it's a new table. We need to create a default team.

image

Member management

Add a Member management page, and the features are as follows:

  • Manage the list of members within a Team, that is, which members of the current team?
  • Manage the roles of each member of the team, that is, what is the role of the members in the current team?

Database table: t_user_role, it's an old table, we need to add the new filed: team_id.

image

Note:

  • Each user can belong to multiple teams
  • Each team can have multiple users
  • Each user can have different roles in different teams, for example: userA is team_admin in team1, userA is developer in team2

Note: User must choose the team in 3 pages: Application, Project and Member Management.

Role management

We just set whether new user is system admin during creating a new user. The other roles will be management in the team management page.

Note: System admin is the super admin for all teams.

Database table: t_user, it's an old table, we need to add the new filed: user_type.

Database table: t_role, it's an old table, we need to add a new role: team_admin. It will be the super admin inside team(manage team members, operate all apps and projects).

image

Compatibility mechanism:

  • All old apps and projects will be migrated to the default team.
  • All old developers will be granted to the default team developer.

ER model

The fields highlighted in the diagram are relational fields.

Team Management ER HL

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@1996fanrui
Copy link
Member Author

Hi @wolfboys , I have sorted out the team feature. Please help take a look in your free time, thanks a lot.

If it's ok, I will start develop the backend code, and try to develop front end. I will let you know, if I need your help.

@lvshaokang
Copy link
Contributor

Hi @1996fanrui, Thanks for you feedback! This is a nice proposal. 
Could you offer the ER model about the team feature to describe their relation in more detail?

@1996fanrui
Copy link
Member Author

Hi @lvshaokang , thanks for your nice suggestion, I have updated the ER model, PTAL in your free time, thanks a lot~

@wolfboys
Copy link
Member

It looks good, The team here is actually the concept of workspace. There are a few issues that need to be clarified

  1. one project or job only belong to one team?
  2. What is the affiliation between users and teams, one to one?
  3. Do we need an association table between team and user (team and job)?

@1996fanrui
Copy link
Member Author

It looks good, The team here is actually the concept of workspace. There are a few issues that need to be clarified

@wolfboys , thank you for reviewing the solution. I have updated the doc for these questions.

  1. one project or job only belong to one team?
  • Each project can only belong to one team.
  • Each app can only belong to one team.
  1. What is the affiliation between users and teams, one to one?
  • Each user can belong to multiple teams
  • Each team can have multiple users
  • Each user can have different roles in different teams, for example: userA is team_admin in team1, userA is developer in team2
  1. Do we need an association table between team and user (team and job)?

Add the team_id to these tables:

  • t_flink_app
  • t_flink_project
  • t_user_role

@wolfboys
Copy link
Member

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants