Skip to content

[permissions - seeds] Give [email protected] restricted rights #12768

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

Merged
merged 8 commits into from
Jun 23, 2025

Conversation

ijreilly
Copy link
Collaborator

Let's introduce an object-limited role for Tim, to test and/or spot incompatibilities with restricted permissions in the future.
Our main user [email protected] is now assigned a role that has all settings permissions, and all object permissions except for update on Pets (to test read-only view) and read on Rockets.
Since we still need an admin user for each workspace we are introducing a new member, Jane, who has the admin role

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR implements an object-restricted role system by modifying Tim's permissions and introducing Jane as a new admin user across test and seed data files.

  • Modified DevSeederPermissionsService to create an 'Object-restricted' role for Tim with limited access (read-only for Pets, no access to Rockets) while maintaining settings permissions
  • Added Jane Austen as a new admin user in seed-users.util.ts and seed-user-workspaces.util.ts with full workspace access
  • Updated integration tests in rest-api-core-create-one.integration-spec.ts and roles.integration-spec.ts to verify new role structure and permissions
  • Fixed incorrect password hash comments in seed data that reference '[email protected]' for Jane's user record
  • Consolidated workspace member IDs across mock data files using consistent UUID format with '20202020-' prefix

11 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

Comment on lines +135 to +139
canReadObjectRecords: true,
canUpdateObjectRecords: false,
canSoftDeleteObjectRecords: false,
canDestroyObjectRecords: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Pet object permissions allow read but block all other operations. This creates an inconsistent state where canSoftDeleteObjectRecords is false but canDestroyObjectRecords is true globally (line 107). Review whether this is intentional.

lastName: 'Austen',
email: '[email protected]',
passwordHash:
'$2b$10$3LwXjJRtLsfx4hLuuXhxt.3mWgismTiZFCZSG3z9kDrSfsrBl0fT6', // [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Incorrect comment stating this is [email protected]'s password hash when it's for [email protected]

Suggested change
'$2b$10$3LwXjJRtLsfx4hLuuXhxt.3mWgismTiZFCZSG3z9kDrSfsrBl0fT6', // tim@apple.dev
'$2b$10$3LwXjJRtLsfx4hLuuXhxt.3mWgismTiZFCZSG3z9kDrSfsrBl0fT6', // jane.austen@apple.dev

Copy link
Contributor

github-actions bot commented Jun 20, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:45930

This environment will automatically shut down when the PR is closed or after 5 hours.

@ijreilly ijreilly enabled auto-merge (squash) June 20, 2025 15:41
@ijreilly ijreilly merged commit 2cb2f52 into main Jun 23, 2025
57 checks passed
@ijreilly ijreilly deleted the seed-role-for-tim-2 branch June 23, 2025 13:46
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