Skip to content

Conversation

@henchaves
Copy link
Member

Description

This PR aims to fix a bug, when a guest user has the AI CREATOR role can't upload artifacts to the project.

Related Issue

GSK-1438 (available on Linear)

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

@henchaves henchaves self-assigned this Jul 25, 2023
@linear
Copy link

linear bot commented Jul 25, 2023

GSK-1438 Invited users can't upload datasets to a project

Currently we run this validation when uploading artifacts to a project:

ai.giskard.security.PermissionEvaluator#canWriteProjectKey

for example:

ai.giskard.web.rest.controllers.UploadController#uploadArtifact

We should also check that if a person is invited to a project he can also write to it

@henchaves henchaves requested a review from kevinmessiaen July 26, 2023 07:20
Copy link
Member

@kevinmessiaen kevinmessiaen left a comment

Choose a reason for hiding this comment

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

Looks good however we also have a method called canWriteProject which doesn't replicate the same logic as in canWriteProjectKey.

Ideally we should have a method canWriteProject(Project project) that is called by both canWriteProject(Long id) and canWriteProjectKey.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@kevinmessiaen kevinmessiaen merged commit a69349c into main Aug 2, 2023
@Hartorn Hartorn deleted the feature/gsk-1438-invited-users-cant-upload-datasets-to-a-project branch September 13, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants