Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools module functionality #2389

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Tools module functionality #2389

wants to merge 19 commits into from

Conversation

alex-odysseus
Copy link
Contributor

Addressing #2330

  • CRUD operations implemented
  • a separate Permission Schema has been created

@Column(name = "description")
private String description;
@Column(name = "is_enabled")
private Boolean isEnabled;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property name should be renamed to 'enabled'

import org.ohdsi.webapi.tool.dto.ToolDTO;
import org.springframework.stereotype.Controller;

import javax.ws.rs.*;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports with * should be eliminated

import java.util.Optional;

@Component
public class ToolConvertor extends AbstractDaoService {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a separate class, to be moved to ToolServiceImpl

return tool;
}

private void setCreationDetails(Tool tool, Instant currentInstant) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need two separate methods

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this class is unclear SimpleDateFormat usage should be sufficient

@@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS ${ohdsiSchema}.tool (
Copy link
Contributor Author

@alex-odysseus alex-odysseus Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can combine all migration scripts into one if necessary

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if you did this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, please mark these migrations attached to V2.15

@anthonysena anthonysena linked an issue Sep 3, 2024 that may be closed by this pull request
@chrisknoll
Copy link
Collaborator

Hello Everyone. Once the migration scripts are combined and the changes @alex-odysseus requests have been implemented, I can pull down the branches to check the functionality.

@anthonysena anthonysena self-assigned this Dec 17, 2024
Comment on lines +12 to +13
put("tool:put", "Update a Tool");
put("tool:post", "Create a Tool");
Copy link
Collaborator

@chrisknoll chrisknoll Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work: what will happen is that when the Tool asset is deleted, all these permissions will be deleted and everyone will lose the ability to create and update a tool.

This is an example of the complication of the permission implementation we have in webapi that we'll want to resolve in 3.x or 4.x.

For details on how the non-entity specific permissions caused issues, you can refer to this issue: #2412.

Essentially, the only permissions that go into PermissionSchema are those with entity-id context. The general ones can't be there because deleting one asset will delete the entire (non-asset specific) set of permissions from everyone.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-odysseus , please provide update to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tools module
5 participants