Base icon indicating copy to clipboard operation
Base copied to clipboard

Active or inactive user: existing code to adjust

Open Xarkam opened this issue 4 years ago • 0 comments

As part of the management of roles / permissions, we have requests that make a join on the link of the role or permission to the user.

Typically queries that determine if "there is a user with own Admin permission" or "there is a role with Admin permission for extension X".

In these two queries, you must exclude non-active users:

  • account not yet activated
  • blocked account
  • see if we have planned other cases.

So add a join on the AspNetUsers table with a condition in the "on" of the join.

Location of the code concerned:

  • AspNetRolesRepository Method FindHavingUsers
  • UserPermissionRepository Method FindBy (string extensionName_, Common.Enums.Permission level_). Be careful, you will have to complete this method by passing for example a bool activeUsersOnly to false by default.

As it is necessary to complete the functional analysis relating to the management of users and their particularities (not yet active, blocked ...), this modification falls within the scope of this epic since the users cannot be modified beforehand.

Info: LockoutEnabled field to true in the User WIF = blocked account.

Xarkam avatar Feb 23 '21 19:02 Xarkam