mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-08 13:36:32 +00:00
parent
48d39b14ee
commit
2a51148eee
@ -504,7 +504,7 @@ public interface CollectionDAO {
|
||||
|
||||
@SqlUpdate(
|
||||
"DELETE from entity_relationship WHERE (toId = :id AND toEntity = :entity) OR "
|
||||
+ "(fromId = :id AND toEntity = :entity)")
|
||||
+ "(fromId = :id AND fromEntity = :entity)")
|
||||
int deleteAll(@Bind("id") String id, @Bind("entity") String entity);
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,9 @@ public class UserRepository extends EntityRepository<User> {
|
||||
/* Add all the teams that user belongs to User entity */
|
||||
private List<EntityReference> getTeams(User user) throws IOException {
|
||||
List<String> teamIds = findFrom(user.getId(), Entity.USER, Relationship.HAS, Entity.TEAM);
|
||||
return EntityUtil.populateEntityReferences(teamIds, Entity.TEAM);
|
||||
List<EntityReference> teams = EntityUtil.populateEntityReferences(teamIds, Entity.TEAM);
|
||||
// return only the non-deleted teams
|
||||
return teams.stream().filter((team) -> !team.getDeleted()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void assignRoles(User user, List<EntityReference> roles) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user