Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DataLayer/ExtraAuthClasses/ModulesForUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ namespace DataLayer.ExtraAuthClasses
/// </summary>
public class ModulesForUser : IChangeEffectsUser, IAddRemoveEffectsUser
{
/// <summary>
/// Empty constructor for migration to work.
/// </summary>
private ModulesForUser() { }

/// <summary>
/// This links modules to a user
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion DataLayer/ExtraAuthClasses/RoleToPermissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static IStatusGeneric<RoleToPermissions> CreateRoleWithPermissions(string
public void Update(string description, ICollection<Permissions> permissions)
{
if (permissions == null || !permissions.Any())
throw new InvalidOperationException("There should be at least one permission associated with a role.");
throw new ArgumentException("There should be at least one permission associated with a role.", nameof(permissions));

_permissionsInRole = permissions.PackPermissionsIntoString();
Description = description;
Expand Down
1 change: 1 addition & 0 deletions DataLayer/ExtraAuthClasses/UserToRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public UserToRole(string userId, RoleToPermissions role)

public static IStatusGeneric<UserToRole> AddRoleToUser(string userId, string roleName, ExtraAuthorizeDbContext context)
{
if (userId == null) throw new ArgumentNullException(nameof(userId));
if (roleName == null) throw new ArgumentNullException(nameof(roleName));

var status = new StatusGenericHandler<UserToRole>();
Expand Down