mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 19:18:05 +00:00
* Issue #535: User is not able to claim ownership of the Topics and dashboards entity.
This commit is contained in:
parent
740dfa11c4
commit
7f10cfb22b
@ -207,6 +207,11 @@ public abstract class DashboardRepository {
|
||||
relationshipDAO().deleteAll(id);
|
||||
}
|
||||
|
||||
@Transaction
|
||||
public EntityReference getOwnerReference(Dashboard dashboard) throws IOException {
|
||||
return EntityUtil.populateOwner(userDAO(), teamDAO(), dashboard.getOwner());
|
||||
}
|
||||
|
||||
public static List<EntityReference> toEntityReference(List<Chart> charts) {
|
||||
List<EntityReference> refList = new ArrayList<>();
|
||||
for (Chart chart: charts) {
|
||||
|
||||
@ -185,6 +185,11 @@ public abstract class TopicRepository {
|
||||
return updated;
|
||||
}
|
||||
|
||||
@Transaction
|
||||
public EntityReference getOwnerReference(Topic topic) throws IOException {
|
||||
return EntityUtil.populateOwner(userDAO(), teamDAO(), topic.getOwner());
|
||||
}
|
||||
|
||||
public Topic createInternal(Topic topic, EntityReference service, EntityReference owner) throws IOException {
|
||||
topic.setFullyQualifiedName(getFQN(service, topic));
|
||||
EntityUtil.populateOwner(userDAO(), teamDAO(), owner); // Validate owner
|
||||
|
||||
@ -255,7 +255,7 @@ public class DashboardResource {
|
||||
Fields fields = new Fields(FIELD_LIST, FIELDS);
|
||||
Dashboard dashboard = dao.get(id, fields);
|
||||
SecurityUtil.checkAdminRoleOrPermissions(authorizer, securityContext,
|
||||
EntityUtil.getEntityReference(dashboard));
|
||||
dao.getOwnerReference(dashboard));
|
||||
dashboard = dao.patch(id, patch);
|
||||
return addHref(uriInfo, dashboard);
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ public class TopicResource {
|
||||
Fields fields = new Fields(FIELD_LIST, FIELDS);
|
||||
Topic topic = dao.get(id, fields);
|
||||
SecurityUtil.checkAdminRoleOrPermissions(authorizer, securityContext,
|
||||
EntityUtil.getEntityReference(topic));
|
||||
dao.getOwnerReference(topic));
|
||||
topic = dao.patch(id, patch);
|
||||
return addHref(uriInfo, topic);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user