Skip to content

[TECHNICAL] Add user role to spaces table - #4698

Merged
jesmrec merged 8 commits into
masterfrom
technical/add_user_role_column_to_spaces
Oct 23, 2025
Merged

jesmrec merged 8 commits into
masterfrom
technical/add_user_role_column_to_spaces

Conversation

@joragua

@joragua joragua commented Oct 21, 2025 •

Copy link
Copy Markdown
Member

Related Issues

App: -

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

Checks: #4698 (comment)

Reports:

@joragua joragua self-assigned this Oct 21, 2025
@joragua joragua changed the title [TECHNICAL] Add user rol to spaces table [TECHNICAL] Add user role to spaces table Oct 21, 2025
@joragua
joragua force-pushed the technical/add_user_role_column_to_spaces branch 2 times, most recently from 929d303 to 2318b84 Compare October 21, 2025 14:59
@joragua
joragua force-pushed the technical/add_user_role_column_to_spaces branch from 2318b84 to 85a208d Compare October 21, 2025 15:42
@joragua
joragua marked this pull request as ready for review October 21, 2025 16:26
@joragua
joragua requested a review from jesmrec October 21, 2025 16:34
@jesmrec

jesmrec commented Oct 22, 2025

Copy link
Copy Markdown
Member

LGTM 👍

@jesmrec

jesmrec commented Oct 22, 2025 •

Copy link
Copy Markdown
Member

QA checks

  • Install from scratch
  • Install from stable (passed in CI)
  • Check DB new field
    • Check correct role
    • Check correct change of role
  • kws account (folders mapped into spaces)
  • Group handling
    • Only individual membership -> role
    • Only one group membership -> role of the group
    • Several group membership with different roles -> major role (manager > editor > viewer)
    • Several group membership with different roles and individual > major role (manager > editor > viewer)
    • Changes of permissions -> correctly reflected in DB
  • Upgrade from prev version

@jesmrec

jesmrec commented Oct 22, 2025 •

Copy link
Copy Markdown
Member

(1) [FIXED]

It seems to be some problems when grantedToV2 points to group instead of a user (by @joragua). The list of spaces is not refreshed and the snackbar server not reached is displayed

Xiaomi Redmi 13 Android 15
Galaxy Tab A8 Android 15
75d1b25a1b

@joragua

joragua commented Oct 22, 2025

Copy link
Copy Markdown
Member Author

Regarding (1), I've added a new field (GroupResponse) to prevent errors while parsing the /me/drives response. I have also implemented additional logic to handle cases when the user belongs to a group with access to a space. The different scenarios for fetching and storing the role in the database are:

  • A user has direct access to a space -> User role
  • A user belongs to a group with access to a space -> Group role
  • A user belongs to several groups with access to a space -> Group role with higher priority
  • A mix: user has both individual and group access to a space -> Role with higher priority

@jesmrec

jesmrec commented Oct 23, 2025

Copy link
Copy Markdown
Member

💯 ✅

@jesmrec
jesmrec merged commit 8e51ed7 into master Oct 23, 2025
@jesmrec
jesmrec deleted the technical/add_user_role_column_to_spaces branch October 23, 2025 07:48
@joragua joragua added this to the 4.7 - Current milestone Oct 24, 2025
@jesmrec jesmrec mentioned this pull request Oct 29, 2025
4 tasks done
@joragua joragua mentioned this pull request Dec 18, 2025
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants