-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Org page improvements #888
Commits on Jul 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 76390a3 - Browse repository at this point
Copy the full SHA 76390a3View commit details -
Hide "Leave Org" button for non-members
Site admins can view any org page, but shouldn't see a "Leave Org" button unless they're actually members of the org.
Configuration menu - View commit details
-
Copy full SHA for 0c13553 - Browse repository at this point
Copy the full SHA 0c13553View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a934c0 - Browse repository at this point
Copy the full SHA 1a934c0View commit details -
Initial implementation of org projects GQL auth
Commented out for now because "orgs can own projects" PR needs to be merged before this will compile.
Configuration menu - View commit details
-
Copy full SHA for f5b446a - Browse repository at this point
Copy the full SHA f5b446aView commit details -
Put list of orgs in JWT, like project list
This will be useful for enforcing GQL permissions such as "non-members can only see the list of admins, members can see other members".
Configuration menu - View commit details
-
Copy full SHA for a5ed538 - Browse repository at this point
Copy the full SHA a5ed538View commit details -
Correct semantics for org members field filtering
Non-org members are allowed to see the list of org admins, so we shouldn't throw an exception here.
Configuration menu - View commit details
-
Copy full SHA for 03fa852 - Browse repository at this point
Copy the full SHA 03fa852View commit details -
Slightly simpler Members middleware implementation
Now that the orgs are listed in the JWT, we could have a slightly simpler implementation of the org.Members field GQL middleware.
Configuration menu - View commit details
-
Copy full SHA for 4ff38f8 - Browse repository at this point
Copy the full SHA 4ff38f8View commit details -
No need to handle orgs claims specially
We handle project claims specially because some users can be in many, many projects, and so we need to squeeze every byte that we can. But for orgs, most users will be in just one, and those who are in more than one are usually going to be in just two or three. So we can just do a simple array and let the standard JSON serialization handle it.
Configuration menu - View commit details
-
Copy full SHA for 96889fe - Browse repository at this point
Copy the full SHA 96889feView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae267da - Browse repository at this point
Copy the full SHA ae267daView commit details -
Adjust o.Projects GraphQL logic
This allows org admins to see all projects, but org members just get to see public projects the same way that non-members do (we might adjust that in the future).
Configuration menu - View commit details
-
Copy full SHA for 5c81fed - Browse repository at this point
Copy the full SHA 5c81fedView commit details -
Configuration menu - View commit details
-
Copy full SHA for c821322 - Browse repository at this point
Copy the full SHA c821322View commit details -
Move org fields middleware into separate classes
Now that these functions are starting to get quite long, they probably belong in their own classes so that OrgGqlConfiguration stays readable.
Configuration menu - View commit details
-
Copy full SHA for c63600e - Browse repository at this point
Copy the full SHA c63600eView commit details -
Hide email column on org page from non-admins
Only site admins are allowed to retrieve users' email addresses, so only site admins should be shown emails on the org page's members table.
Configuration menu - View commit details
-
Copy full SHA for d760eb6 - Browse repository at this point
Copy the full SHA d760eb6View commit details -
Improve GraphQL logic for org.Projects list
There's no need to throw an exception if the org ID can't be found; just handle that situation the same way as if a non-member were sending the GraphQL query, and return only public projects just to be safe.
Configuration menu - View commit details
-
Copy full SHA for 458a54b - Browse repository at this point
Copy the full SHA 458a54bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e04b813 - Browse repository at this point
Copy the full SHA e04b813View commit details -
The createGuestUserByAdmin function in user.ts is typed as returning a LexAuthUser, which means that it needs the new `orgs` property in order to pass the type test. So we need to query it from the GraphQL result.
Configuration menu - View commit details
-
Copy full SHA for e252180 - Browse repository at this point
Copy the full SHA e252180View commit details -
This will allow org admins to see all details (including email addresses) of users in the orgs they manage.
Configuration menu - View commit details
-
Copy full SHA for 0c0f378 - Browse repository at this point
Copy the full SHA 0c0f378View commit details -
Attempt to use orgMemberById query in frontend
Not working yet due to type errors.
Configuration menu - View commit details
-
Copy full SHA for f8bea36 - Browse repository at this point
Copy the full SHA f8bea36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b00283 - Browse repository at this point
Copy the full SHA 2b00283View commit details -
Forbid non-project members from loading project page
Now that orgs can own projects, and anyone can see the list of projects that an org owns, non-project members will sometimes be clicking on project links. Changing the project table to hide links if the viewer doesn't have permission is complicated, so for now we'll go with the simple expedient of showing a 404 page if the user clicks on a link to a project he's not supposed to see. We'll change this later.
Configuration menu - View commit details
-
Copy full SHA for a026b46 - Browse repository at this point
Copy the full SHA a026b46View commit details -
Revert "Forbid non-project members from loading project page"
This reverts commit 349556c. Going to take a different approach: create a new permission called CanViewProject, and rename CanAccessProject to CanSyncProject.
Configuration menu - View commit details
-
Copy full SHA for e884b0b - Browse repository at this point
Copy the full SHA e884b0bView commit details -
Rename CanAccessProject to CanSyncProject
We'll create a new CanViewProject permission for read-only access to the project metadata without repo access.
Configuration menu - View commit details
-
Copy full SHA for fbaabf8 - Browse repository at this point
Copy the full SHA fbaabf8View commit details -
Use ViewProject permission in ProjectByCode query
This allows public projects to let anyone view them, but still requires project membership in order to access the repository.
Configuration menu - View commit details
-
Copy full SHA for f174aa1 - Browse repository at this point
Copy the full SHA f174aa1View commit details -
Have test org own elawa project at startup
This will allow testing that people who are not members of an org can only see projects that are truly public (isConfidential == false) and not projects where isConfidential == null. In order words, testing that we're not failing open for projects with unknown confidentiality.
Configuration menu - View commit details
-
Copy full SHA for 75718b8 - Browse repository at this point
Copy the full SHA 75718b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6965bd9 - Browse repository at this point
Copy the full SHA 6965bd9View commit details -
Query project confidentiality in org page GQL
This is needed so that OrgProjectsVisibilityMiddleware can actually see the isConfidential value. If isConfidential is not included in the GQL query then the middleware sees it as null and defaults to private, thus hiding projects that would have been visible.
Configuration menu - View commit details
-
Copy full SHA for a400a0c - Browse repository at this point
Copy the full SHA a400a0cView commit details -
Mention need for correct middleware order
Also remove no-longer-needed comment at same time
Configuration menu - View commit details
-
Copy full SHA for 9800d59 - Browse repository at this point
Copy the full SHA 9800d59View commit details -
Rename JWT refresh key to better reflect usage
We should move it to an appropriate location and share it.
Configuration menu - View commit details
-
Copy full SHA for fc07f06 - Browse repository at this point
Copy the full SHA fc07f06View commit details -
write tests for expected org permissions. Provide custom gql config f…
…or the orgById query.
Configuration menu - View commit details
-
Copy full SHA for 8a361cb - Browse repository at this point
Copy the full SHA 8a361cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for b10cc8f - Browse repository at this point
Copy the full SHA b10cc8fView commit details -
Implement most project and member filtering in orgById
Still need to implement removing email addresses from members list, if the query asked for them without proper permission.
Configuration menu - View commit details
-
Copy full SHA for 72d5dd4 - Browse repository at this point
Copy the full SHA 72d5dd4View commit details -
Public projects have isConfidential *false*, not true.
Configuration menu - View commit details
-
Copy full SHA for 7862c73 - Browse repository at this point
Copy the full SHA 7862c73View commit details -
The "editor" user is a member of the test org; this test wants a non-member.
Configuration menu - View commit details
-
Copy full SHA for f71e419 - Browse repository at this point
Copy the full SHA f71e419View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e600ea - Browse repository at this point
Copy the full SHA 0e600eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c7c9ad - Browse repository at this point
Copy the full SHA 0c7c9adView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9c0bd0 - Browse repository at this point
Copy the full SHA f9c0bd0View commit details -
Make test fail with deliberate bug present in code
This proves that the test will catch this bug.
Configuration menu - View commit details
-
Copy full SHA for 1439ed5 - Browse repository at this point
Copy the full SHA 1439ed5View commit details -
Remove deliberate bug, tests now pass
This proves that the test suite is now catching the bug.
Configuration menu - View commit details
-
Copy full SHA for a0a88b6 - Browse repository at this point
Copy the full SHA a0a88b6View commit details -
Allow querying username in orgById (manager only)
Also include unit tests to prove that non-managers cannot see usernames.
Configuration menu - View commit details
-
Copy full SHA for 032a504 - Browse repository at this point
Copy the full SHA 032a504View commit details -
Query username in org page, don't use locked or emailVerified fields
The org members table doesn't need to show the "user is locked" or "email not verified" icons; those can be left on the admin dashboard. But we do want the org managers to be able to see members' usernames, since there may very well be guest users in the org with usernames but no email addresses, and org managers should be able to help them get Send/Receive configuration set up properly.
Configuration menu - View commit details
-
Copy full SHA for 8cc5e01 - Browse repository at this point
Copy the full SHA 8cc5e01View commit details -
Configuration menu - View commit details
-
Copy full SHA for c860c72 - Browse repository at this point
Copy the full SHA c860c72View commit details -
Expose email/username column to org managers
Org page show shows the email/username column to org managers/admins, because we have decided that they're allowed to see it and have implemented GraphQL rules to that effect.
Configuration menu - View commit details
-
Copy full SHA for 84df3f0 - Browse repository at this point
Copy the full SHA 84df3f0View commit details -
Allow org managers to view Created By for members
Org managers, like admins, should be able to see who created a guest user's account. We expose this in the UserModal by adding createdBy to the orgMemberById query.
Configuration menu - View commit details
-
Copy full SHA for 11647b6 - Browse repository at this point
Copy the full SHA 11647b6View commit details
Commits on Jul 3, 2024
-
Simplify OrgMemberById permission checks
We have that logic in PermissionService now, so let's use it.
Configuration menu - View commit details
-
Copy full SHA for c977814 - Browse repository at this point
Copy the full SHA c977814View commit details -
Simplify view logic for org projects
We decided that people who aren't org members can still see the projects that they themselves are a member of, which means the rule for projects is the same for both members and non-members so the code gets simpler.
Configuration menu - View commit details
-
Copy full SHA for e2b1fcd - Browse repository at this point
Copy the full SHA e2b1fcdView commit details -
Configuration menu - View commit details
-
Copy full SHA for a95f34f - Browse repository at this point
Copy the full SHA a95f34fView commit details
Commits on Jul 4, 2024
-
Move REFRESHED_USER_KEY to public const string
Now there's a single source of truth for the two middleware classes that need to reference it.
Configuration menu - View commit details
-
Copy full SHA for 79859a9 - Browse repository at this point
Copy the full SHA 79859a9View commit details -
The LoginAs method needs to be virtual so that it can be mocked when non-integration tests are running, otherwise the mock will still try to log in to a server that isn't there.
Configuration menu - View commit details
-
Copy full SHA for b62400f - Browse repository at this point
Copy the full SHA b62400fView commit details