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

Fix write access for public sessions #245

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

thinkh
Copy link
Member

@thinkh thinkh commented Nov 8, 2019

Closes #176

Summary

Independent of the granted permissions users were only allowed to clone a persistent session. Now, the write permission is checked and the select button is displayed. For read permission only the select button is not shown.

Test

  1. Created three sessions:
    • Session shared with zen_austin as buddy
      grafik
    • Public session everyone can write
      grafik
    • Public session everyone can read
      grafik
  2. Login as user zen_austin
  3. Open the persistent session section
    grafik

Independent of the granted permissions users were only allowed to clone a persistent session. Now, the write permission is checked and the select button is displayed. For read permission only the select button is not shown.
Copy link

@lehnerchristian lehnerchristian left a comment

Choose a reason for hiding this comment

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

looks good and worked for me 👍

one minor thing, and I don't think that's part of the ticket, is that when a buddy opens a session with write access and adds some actions to the provenance graph the user needs to click "Edit Details" and then save without editing the details to override the session. Maybe we should add a dedicated "Override Session" button which just stores the session in the DB without a dialog? also the "Save Session" button is a bit misleading, because it is disabled, because that's what I wanted to achieve namely saving the new session

should we create a new ticket for this?

@thinkh
Copy link
Member Author

thinkh commented Nov 15, 2019

@lehnerchristian Thanks for your review. Do you mean the following behavior?

I opened a public session with write access and the Save Sesssion menu item is disabled.

grafik

Looking at the code the behavior seems to be intended:

updateGraphMetaData(graph: ProvenanceGraph) {
this.node.querySelector('span.session-name').innerHTML = graph.desc.name;
const syncIcon = this.node.querySelector('.sync-indicator');
const persisted = isPersistent(graph.desc);
const persistAction = (<HTMLLinkElement>this.node.querySelector('a[data-action="persist"]').parentElement);
if (persisted) {
syncIcon.classList.remove('fa-clock-o');
syncIcon.classList.add('fa-cloud');
persistAction.classList.add('disabled');
} else {
syncIcon.classList.add('fa-clock-o');
syncIcon.classList.remove('fa-cloud');
persistAction.classList.remove('disabled');
}
}

Save Session migrates a temporary session to a persistent session. New states (i.e., nodes and actions) of the persistent session are synchronized automatically. Hence, there is no need for the save action anymore. On the one hand, we could probably hide the save session button, but on the other hand it might confuse the user. In both cases it might be a new issue and PR. 😉

@thinkh thinkh merged commit 562086d into develop Nov 15, 2019
@thinkh thinkh deleted the thinkh/176_fix-write-access-for-public-sessions branch November 15, 2019 13:56
@lehnerchristian
Copy link

@lehnerchristian Thanks for your review. Do you mean the following behavior?

I opened a public session with write access and the Save Sesssion menu item is disabled.

grafik

Looking at the code the behavior seems to be intended:

updateGraphMetaData(graph: ProvenanceGraph) {
this.node.querySelector('span.session-name').innerHTML = graph.desc.name;
const syncIcon = this.node.querySelector('.sync-indicator');
const persisted = isPersistent(graph.desc);
const persistAction = (<HTMLLinkElement>this.node.querySelector('a[data-action="persist"]').parentElement);
if (persisted) {
syncIcon.classList.remove('fa-clock-o');
syncIcon.classList.add('fa-cloud');
persistAction.classList.add('disabled');
} else {
syncIcon.classList.add('fa-clock-o');
syncIcon.classList.remove('fa-cloud');
persistAction.classList.remove('disabled');
}
}

Save Session migrates a temporary session to a persistent session. New states (i.e., nodes and actions) of the persistent session are synchronized automatically. Hence, there is no need for the save action anymore. On the one hand, we could probably hide the save session button, but on the other hand it might confuse the user. In both cases it might be a new issue and PR. wink

ok, didn't know that when the provenance graph changes it is automatically updated in the DB. thanks for the clarification 🙂

@thinkh thinkh added release: patch PR merge results in a new patch version type: bug Something isn't working labels Nov 22, 2019
@thinkh thinkh mentioned this pull request Nov 22, 2019
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: patch PR merge results in a new patch version type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants