Skip to content

Added table for full admin access #165

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

lumburovskalina
Copy link
Collaborator

@lumburovskalina lumburovskalina commented Apr 24, 2025

__table_args__ = {"schema": "global"}
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
email = Column(String, unique=True)
meta_info = Column(JSON)
Copy link
Member

Choose a reason for hiding this comment

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

what is this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for now it is not used, but i added it for any additional configuration if we need it in future

Copy link
Contributor

@andhreljaKern andhreljaKern Apr 29, 2025

Choose a reason for hiding this comment

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

IMO we should be using a different approach here. Instead of the full_admin_access table, we should create a user_role (id, name) table and expand the user model to include user_role_id_fk. Role name should, for now, contain values user and admin (additionally maybe superuser for even more elevated permissions). We could default all existing users to the role user and only set admin or superuser manually (or through admin-dashboard).

This way, we can further expand on permissions in the future by adding a new table user_role_permissions (id, user_role_id_fk, permission_target, permission, permission_target_id NULLABLE) with e.g. record (<uuid>, <uuid>, 'refinery_project', 'read_write', <refinery_project uuid>).

Copy link
Member

Choose a reason for hiding this comment

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

for now we keep it as currently implemented. We need to rework the role system at some point for the whole application and a partial but more complex solution will only add to the complexity when we have the change to implement. For now a simple lookup in a table is sufficient

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.

3 participants