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

Experiment/change user group #663

Merged
merged 31 commits into from
May 22, 2023
Merged

Experiment/change user group #663

merged 31 commits into from
May 22, 2023

Conversation

zak39
Copy link
Collaborator

@zak39 zak39 commented Jan 10, 2023

No description provided.

@zak39 zak39 self-assigned this Jan 11, 2023
@zak39 zak39 added backend Modification related to backend frontend Modification related to frontend refactor labels Jan 11, 2023
@zak39 zak39 force-pushed the experiment/change-user-group branch from ac309b2 to 66df5a7 Compare March 8, 2023 11:26
@zak39 zak39 force-pushed the experiment/change-user-group branch from 56bff5a to 9b314cb Compare April 7, 2023 08:26
@zak39 zak39 added the draft Don't accept the PR label Apr 11, 2023
@zak39
Copy link
Collaborator Author

zak39 commented May 4, 2023

@dorianne-arawa I cannot accept this PR for the moment.

I have a little bug renaming a subgroup (look at the screenshot below).

image

@zak39
Copy link
Collaborator Author

zak39 commented May 4, 2023

Okay @dorianne-arawa I fixed it. It's okay, I can accept this Pull Request.

@dorianne-arawa
Copy link
Collaborator

Perfect @zak39

zak39 added 20 commits May 17, 2023 17:05
I created the getUserGroup function to get the old user group (SPACE-U-)
and the new user group (SPACE-Users-).

Back-End side only for the moment.

Signed-off-by: Baptiste Fotia <[email protected]>
I changed the user group name (U-<id>) when I create a space.
But, the old groupname for the user is preserved if the user end update
the workspace app.

Signed-off-by: Baptiste Fotia <[email protected]>
The getUserGroup has to return the GID with the space name as suffix for new workspaces.
For old workspaces, it's the space id which is returned.

Signed-off-by: Baptiste Fotia <[email protected]>
I changed the key 'space_name' for 'space' in the Vue.js, Js and PHP
files.

Signed-off-by: Baptiste Fotia <[email protected]>
Now, when we create a workspace, the GE-<id> and U-<id> groups are replaced by the "WM-<space_name>" and "U-<space_name>" groups.

Signed-off-by: Baptiste Fotia <[email protected]>
I splited the GroupWorkspace class into 2 classes : UserGroup.php and
WorkspaceMangerGroup.php.
The GroupWorkspace class is an abstract class.

I changed the files related to GroupWorkspace class

Signed-off-by: Baptiste Fotia <[email protected]>
I don't export ESPACE_MANAGER, ESPACE_USERS and ESPACE_GID. But I
replace them with PREFIX_USER and PREFIX_MANAGER.

Signed-off-by: Baptiste Fotia <[email protected]>
I cancelled a previous commit because I changed the signature of the
getUserGroup function.

Signed-off-by: Baptiste Fotia <[email protected]>
I renamed all constants from GroupsWorkspace to be readable for human.

Signed-off-by: Baptiste Fotia <[email protected]>
We can define a dynamic prefix for all workspaces.

Signed-off-by: Baptiste Fotia <[email protected]>
Now, we can apply the new convetion after an upgrade of the Workspace
app.

Signed-off-by: Baptiste Fotia <[email protected]>
Signed-off-by: Baptiste Fotia <[email protected]>
We can create a subgroup with this pattern :

- gid: SPACE-G-<groupname>-<spaceId>
- displayName: G-<groupname>-<spaceName>

It works when we create a subgroup.
We have to change for rename and delete, may be.

Signed-off-by: Baptiste Fotia <[email protected]>
We initialized the Upgradev300 class from the Register's construct and
it doesn't get the prefix values.

Signed-off-by: Baptiste Fotia <[email protected]>
Now, all subgroup will be their display name changed when we migrate to
v3.0.0.

Signed-off-by: Baptiste Fotia <[email protected]>
I splitted the algorithm to upgrade to v3.0.0 or more.
I added the license too.

Signed-off-by: Baptiste Fotia <[email protected]>
I added the license for the GroupFoldersGroupsMapper file.
I must have forgotten it.

Signed-off-by: Baptiste Fotia <[email protected]>
I moved the new GroupsWorkspace.php, WorkspaceManagerGroup.php,
ManagersWorkspace.php and UserGroup.php files in the Service > Group
folder.

Signed-off-by: Baptiste Fotia <[email protected]>
zak39 added 8 commits May 17, 2023 17:49
Signed-off-by: Baptiste Fotia <[email protected]>
Following this problem in the CI :
https://github.com/arawa/workspace/actions/runs/4788667321/jobs/8515575242?pr=663
.

I could not fix the problem with the cs:check command.
So, I fixed it manually.

Signed-off-by: Baptiste Fotia <[email protected]>
The cs:check command is broken. So, I fixed it manually.

Signed-off-by: Baptiste Fotia <[email protected]>
We send the SPACE-GE as GID's prefix when we use the isInGroup()
function.

Signed-off-by: Baptiste Fotia <[email protected]>
Use the PREFIX_DISPLAYNAME_SUBGROUP_SPACE const instead of the PREFIX_GID_SUBGROUP_SPACE when we want to rename a group.

Signed-off-by: Baptiste Fotia <[email protected]>
Signed-off-by: Baptiste Fotia <[email protected]>
@zak39 zak39 force-pushed the experiment/change-user-group branch from 7fb4238 to 77917d8 Compare May 17, 2023 16:34
Signed-off-by: Baptiste Fotia <[email protected]>
@zak39
Copy link
Collaborator Author

zak39 commented May 17, 2023

@acdmft can you review my code again please ? 🙏

I rebased my PR to keep up to date

@zak39 zak39 removed the draft Don't accept the PR label May 22, 2023
@zak39 zak39 requested a review from acdmft May 22, 2023 08:24
@acdmft
Copy link
Collaborator

acdmft commented May 22, 2023

Very good!

@acdmft acdmft merged commit 2271730 into main May 22, 2023
@acdmft acdmft deleted the experiment/change-user-group branch May 22, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Modification related to backend frontend Modification related to frontend refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants