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

Migrate user permissions from previous release #916

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

jjmerchante
Copy link
Contributor

The previous release included the users' permissions in the Group Django model. In the new release, they are included in the Tenant model. This code migrates the permissions for all the users.

Related to #849

Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is ok but the problem that I see is the first time the user migrates. It won't be any user an any group.

@jjmerchante
Copy link
Contributor Author

If they are included in a tenant, they will have readonly permissions. I can change that to user permissions.

@sduenas
Copy link
Member

sduenas commented Aug 30, 2024

If they are included in a tenant, they will have readonly permissions. I can change that to user permissions.

Is that true? I mean, they have those permissions but there's no entry in the database saying that they have those permissions. The table auth_user_groups is empty.

@jjmerchante
Copy link
Contributor Author

Is that true? I mean, they have those permissions but there's no entry in the database saying that they have those permissions. The table auth_user_groups is empty.

I think you mean that I forgot to migrate the permissions when multitenancy is disabled. I have updated that. Additionally, I changed the default permissions to user when multi-tenant is enabled, to match what it was before the update.

Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sduenas
Copy link
Member

sduenas commented Aug 30, 2024

Is that true? I mean, they have those permissions but there's no entry in the database saying that they have those permissions. The table auth_user_groups is empty.

I think you mean that I forgot to migrate the permissions when multitenancy is disabled. I have updated that. Additionally, I changed the default permissions to user when multi-tenant is enabled, to match what it was before the update.

Yes, that's what I meant.

User permissions are stored in a separate table within
the database. These permissions will be automatically
migrated when running sortinghat-admin upgrade.

Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com>
@jjmerchante jjmerchante merged commit f5771c9 into chaoss:master Sep 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants