Skip to content

Commit

Permalink
Fixed user check
Browse files Browse the repository at this point in the history
  • Loading branch information
HeDo88TH committed Sep 20, 2022
1 parent 8da5faa commit e56f60b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Registry.Web/Services/Managers/AuthManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public async Task<bool> RequestAccess<T>(T obj, AccessType access, User user)
if (obj == null)
throw new ArgumentNullException(nameof(obj));

if (user == null)
throw new ArgumentNullException(nameof(user));

return typeof(T) switch
{
_ when typeof(T) == typeof(Organization) => await RequestAccessToOrganization(obj as Organization, access,
Expand All @@ -109,7 +106,7 @@ private async Task<bool> RequestAccessToDataset(Dataset dataset, AccessType acce

var meta = ddb.Meta.GetSafe();

// Anonymous users can only read if the dataset is public or unlisted
// Anonymous users can only read if the dataset is public
if (user == null)
return access == AccessType.Read && (meta.Visibility == Visibility.Public || meta.Visibility == Visibility.Unlisted);

Expand Down

0 comments on commit e56f60b

Please sign in to comment.