Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Feature/02 user system #6

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Feature/02 user system #6

wants to merge 20 commits into from

Conversation

mataai
Copy link
Owner

@mataai mataai commented Mar 15, 2024

No description provided.

Comment on lines 37 to 40
else
{
// TODO: throw custom exception
}

Choose a reason for hiding this comment

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

C'est plus un opinion personnelle qu'autre chose, mais lorsqu'on tente de supprimer une entity qui n'extiste déjà plus on peut retourner true cela fait pas de mal.

Comment on lines 155 to 165
if (role != null)
{
_context.Roles.Remove(role);
_context.SaveChanges();
return true;
}
else
{
// TODO: throw custom exception
return false;
}

Choose a reason for hiding this comment

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

Même principe que plustôt. Moi je retournerai true même si le Role n'existe pas puisqu'au finale on a le résultat voulue.

Choose a reason for hiding this comment

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

Cela s'applique pour la majorité de tes fichier. Ajoute des new line après chaque méthode pour augmenter la lisibilité du code. Tout à l'air pogner ensemble :P

Comment on lines 25 to 26
[HttpGet("Roles")]
public IActionResult GetRoles()

Choose a reason for hiding this comment

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

Pour tout tes endpoints tu vas probablement vouloir ajouter plus d'attribue pour rendre ton swagger plus détailler.

Exemple : https://stackoverflow.com/questions/52883466/how-to-add-method-description-in-swagger-ui-in-webapi-application

Comment on lines 20 to 25
modelBuilder.Entity<Permission>()
.Property(p => p.Id)
.ValueGeneratedOnAdd();
modelBuilder.Entity<Permission>()
.HasIndex(p => new { p.System, p.Action })
.IsUnique();
Copy link

@olivierguy93 olivierguy93 Mar 16, 2024

Choose a reason for hiding this comment

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

Aulieu de mettre la configuration de tes entity directement dans le OnModelCreating. De les grouper dans une class à part. Exemple : https://learn.microsoft.com/en-us/ef/core/modeling/

à longterme cela vas permettre de garder ton DataContext petit et lisible ^^

@mataai mataai force-pushed the feature/02-user-system branch from eabb445 to 1681cb7 Compare March 20, 2024 21:56
Copy link

gitguardian bot commented Jun 4, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- Generic Password 1121af0 WebAPI/Program.cs View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants