Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • U userutils
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • userutils
  • Issues
  • #37
Closed
Open
Created Jan 01, 2021 by SamwiseFilmore@MggMugginsDeveloper

Move AllGroupsExt into redox_users and Prevent Unintended Behavior

I think the functionality that's provided by AllGroupsExt is valuable enough that it could possibly be used by other users of redox_users. It should probably be moved out of this crate and into that one.

@omac777 Brought up a couple of good points:

  • for atomicity's sake, all groups should exist before you add the user to the existing groups
  • ensure when adding user to a group, the user should not [be in the group] beforehand. [If] the user already exists, return an error condition useralreadyexists of some sort and recover gracefully continuing to add the user to other groups.

There's a chance without doing the above that you will be adding the user to some groups, but the non-existing group will fail the operation and the user might not get added to the remaining existing groups.

There's a chance that you might double-add a user to a group the way things are read.

For all the situations in this crate, error conditions are always fatal. However, if/when these functions get moved, they should be improved in these ways to prevent these situations from happening, since one of these returning an error condition doesn't necessarily prevent a save being called.

Assignee
Assign to
Time tracking