[AC-1174] Refactor permission logic to target master
- Remove references to "Manage" flag on CollectionUser and CollectionGroups
- Revert to current collection permission checks in the auth handler
- Fix unit tests
- Remove references to "Manage" in SQL sprocs and EF queries
@ -71,10 +71,17 @@ public class CollectionAuthorizationHandler : BulkAuthorizationHandler<Collectio
@@ -71,10 +71,17 @@ public class CollectionAuthorizationHandler : BulkAuthorizationHandler<Collectio
return;
}
// List of collection Ids the acting user is allowed to manage
// Acting user does not have permission to edit assigned collections, fail
if(!org.Permissions.EditAssignedCollections)
{
context.Fail();
return;
}
// List of assigned collection Ids for the acting user
@ -491,7 +491,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
@@ -491,7 +491,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
OrganizationUserId=requestedUser.Id,
HidePasswords=requestedUser.HidePasswords,
ReadOnly=requestedUser.ReadOnly,
Manage=requestedUser.Manage
});
continue;
}
@ -499,7 +498,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
@@ -499,7 +498,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
@ -528,8 +526,7 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
@@ -528,8 +526,7 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
CollectionId=collectionId,
GroupId=requestedGroup.Id,
HidePasswords=requestedGroup.HidePasswords,
ReadOnly=requestedGroup.ReadOnly,
Manage=requestedGroup.Manage
ReadOnly=requestedGroup.ReadOnly
});
continue;
}
@ -537,7 +534,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect
@@ -537,7 +534,6 @@ public class CollectionRepository : Repository<Core.Entities.Collection, Collect