BinaryStudioAcademy / bsa-2024-gitfit

Application for collecting and analyzing developers activity on git based projects.
https://git-fit.net/
2 stars 0 forks source link

feat: Adjust root permissions #350

Closed liza-veis closed 2 months ago

liza-veis commented 2 months ago

What feature?

Adjust needed permissions and make sure all of them work as expected. The resources should be disabled on the backend as well.

Rules:

Screenshots

No response

VeronikaHordus commented 2 months ago

For QA: Check whether the link on the Logo on header redirects users to correct pages with certain permission type.

GvoFor commented 2 months ago

Questions

liza-veis commented 2 months ago

If rule states "...: View All Projects, Manage All Projects.", then this means that user shoud have AT LEAST one of the listed permissions, right? (or all of them?)

yes, one of them.

If there is nothing left to display in the menu (for example user has only View All Projects permission and not Manage All Projects, then both edit and delete options should disapear), then I should not render the menu component (button with ellipsis) itself at all, right?

yes, would be nice to hide the options menu.

In rules list, Manage Access permission was mentioned, but currently in project we have Manage User Access. Are these the same permissions? or should I create new Manage Access permission? or should I rename Manage User Access to Manage Access?

yep, It's the sam permission, no need to rename or create a new one.

Our project details page contains contributors list and it can be accessed with just View All Projects permission, but Contributors page can be accessed only with Manage All Projects permission. So should I render contributors list in this case?

Contributors page will be for all contributors configuration, so only users with Manage All Projects (who is able to edit contributors) can access it. It will be hard to show all contributors, but disable actions for some of them if user has/doesn't have project-specific permissions. But it's ok for the project details page, + contributors on this page are mostly for view and tracking purposes, so users with View All Projects permission should see them.

VeronikaHordus commented 2 months ago

@GvoFor Everything seem to work as required, only I have one point to make clear. The Project Access Managment page is unaccessible for user with Manage Access rights untill he has also the View All Projects permission. (If I wold paste the URL of the Project Access Managment page I am redirected to the 404 page). Is that right?

GvoFor commented 2 months ago

Hi. Thanks for noticeing. Looks like a bug for me. I think I should fix it However I'm not sure

GvoFor commented 2 months ago

@VeronikaHordus Hello. I have fixed the issue. Now the Project Access Management page available only if user has Manage User Access permission AND either View or Manage All Projects

VeronikaHordus commented 2 months ago

Thank you, Will check it today đź‘Ť

@VeronikaHordus Hello. I have fixed the issue. Now the Project Access Management page available only if user has Manage User Access permission AND either View or Manage All Projects

VeronikaHordus commented 2 months ago

@GvoFor I have 2 bugs here. So I will return the ticket in ToDo :(

  1. The options button Contributors on the Project Details page is availible to "View All Projects" users. (They shouldn't see Options button as well as Edit or Merge them, this is availible only for Manage All Projects permission type) https://github.com/user-attachments/assets/aa04d1a5-04c2-48d0-8eb3-9dfa6ecd2303
VeronikaHordus commented 2 months ago
  1. The "Manage Access" option is listed in the Options on the Project Details page for "Manage All Projects" permission type. (This option should not be availible. A click on the "Manage Access" for specific project redirects to the Root Projects page.

https://github.com/user-attachments/assets/b80696ac-7896-4339-a7fb-9a9ef5ae0d4b Image On the picture pay attention that User does not have any extra permissions (Such as Manage User Access) - so the page is unavailible on the sidebar.

GvoFor commented 2 months ago

Thanks for noticing! New functionality was added and I didn't adjust right permissions for it. I'll fix it as soon as possible

GvoFor commented 2 months ago

@VeronikaHordus Hi again. I'm confused with the second bug you described. It's a bit contrudict with https://github.com/BinaryStudioAcademy/bsa-2024-gitfit/issues/411 ticket and @liza-veis suggestion. Could you clarify with @AnnaRomaniuta and @liza-veis what should be expected behaviour, please

AnnaRomaniuta commented 2 months ago

@GvoFor I had this ticket and it was indicated here that this access should be available.

GvoFor commented 2 months ago

Do I understand correctly?:

AnnaRomaniuta commented 2 months ago

Yesterday, the user with Manage User Access didn't have access to the project, instead the user with Manage All Projects permission had all rights to create projects and projects groups. But today everything seems to have changed, I also want to know the final solution from @liza-veis because I`m also confused.

liza-veis commented 2 months ago

Do I understand correctly?:

  • Root Access Management page available only with Manage User Access
  • Project Access Management page available in two cases:

    1. User has Manage User Access and View All Projects permissions
    2. User has Manage All Projects permission

yes, this is correct, can look a bit strange, but this is because we have a small set of permissions. Usually, the user has permission for each separate operation.

VeronikaHordus commented 2 months ago

Oh okay, sorry @GvoFor then perhaps I got it wrong from the conversation in the chat. Let’s then keep it for Manage All Project available

VeronikaHordus commented 2 months ago

Works good, thank you! The only issue is the unability to update personal profile, but this one is already in proccess