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

Allow for widgets to restrict who can publish instances. #1199

Conversation

FrenjaminBanklin
Copy link
Contributor

@FrenjaminBanklin FrenjaminBanklin commented Feb 12, 2019

Closes #1198.

Made a migration to track whether a widget is restricted for student creation or not.
Adjusted installer to account for a new install.yaml property corresponding to the new field.
Adjusted widget catalog lookup to omit author_only widgets when non-author users are looking at the catalog.
Fixed My Widgets page not properly disabling copy/delete buttons for users who lack appropriate access to a widget instance.

Essentially allows widgets to define themselves as 'non-student' widgets, meaning students cannot create new instances of them.

Release alongside ucfopen/Materia-Server-Client-Assets#47.

… for student creation or not. Adjusted installer to account for a new install.yaml property corresponding to the new field. Adjusted widget catalog lookup to omit author_only widgets when non-author users are looking at the catalog. Fixed My Widgets page not properly disabling copy/delete buttons for users who lack appropriate access to a widget instance.
@FrenjaminBanklin FrenjaminBanklin changed the base branch from master to dev/5-ifirit February 12, 2019 16:07
@FrenjaminBanklin FrenjaminBanklin changed the title Allow for widgets to be 'author only'. WIP: Allow for widgets to be 'author only'. Feb 13, 2019
@FrenjaminBanklin
Copy link
Contributor Author

Talked about it a bit, this might need to change.

Instead of restricting who can create a widget, adjust this idea - rather than only allowing basic_author users to create the widget, forbid anybody other than a basic_author from publishing the widget. Essentially non-authors can create and preview the widget, but in order to publish the widget it would need to be shared with somebody who has basic_author permission.

…ing who can publish widgets; rewrote migration, added checks etc. Added migration to keep track of the user who published a widget.
@FrenjaminBanklin FrenjaminBanklin changed the title WIP: Allow for widgets to be 'author only'. WIP: Allow for widgets to restrict who can publish instances. Feb 19, 2019
@FrenjaminBanklin FrenjaminBanklin changed the title WIP: Allow for widgets to restrict who can publish instances. Allow for widgets to restrict who can publish instances. Feb 19, 2019
@FrenjaminBanklin FrenjaminBanklin requested a review from a team February 19, 2019 20:29
@FrenjaminBanklin FrenjaminBanklin changed the title Allow for widgets to restrict who can publish instances. WIP:Allow for widgets to restrict who can publish instances. Feb 20, 2019
…d of if a widget instance is publishable by a user. Changed tests to match.
@FrenjaminBanklin FrenjaminBanklin changed the title WIP:Allow for widgets to restrict who can publish instances. Allow for widgets to restrict who can publish instances. Feb 20, 2019
@iturgeon iturgeon changed the base branch from dev/5-ifirit to master February 20, 2019 16:34
@iturgeon iturgeon changed the base branch from master to dev/5-ifirit February 20, 2019 16:34
fuel/app/themes/default/partials/widget/create.php Outdated Show resolved Hide resolved
fuel/app/themes/default/partials/widget/create.php Outdated Show resolved Hide resolved
fuel/app/classes/materia/api/v1.php Outdated Show resolved Hide resolved
fuel/app/classes/materia/api/v1.php Outdated Show resolved Hide resolved
fuel/app/classes/materia/widget/installer.php Outdated Show resolved Hide resolved
Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

Reviewed:

  • Added restrict_publish: Yes to a widget's install.yaml
  • Created an instance of the widget as a student, received on-publish notification that the widget is restricted.
  • Shared the widget with another user with the basic_author role
  • basic_author user was able to edit and publish the widget
  • Revoking the basic_author user and attempting to edit as the student user gave me a restricted access dialog

The process appears to work well. My only suggestion is that the on-publish notification doesn't suggest or provide any sort of action. Could we add a button to save the widget as a draft, or inform the user that they need to save the widget as a draft and share the widget with a basic_author user from the collab screen?

In the future, it'd be really cool if we could provide an option within that space to add a collaborator right then and there, instead of saving a draft and navigating to My Widgets first - but I think this is good for now.

@iturgeon
Copy link
Member

Oh man, I like that inline collaborator workflow idea @clpetersonucf . Add it as a new feature issue

@clpetersonucf clpetersonucf merged commit d1241fd into ucfopen:dev/5-ifirit Apr 1, 2019
@iturgeon iturgeon added this to the Ifrit (~5) milestone Jun 3, 2019
@FrenjaminBanklin FrenjaminBanklin deleted the issue/1198-restrict-widget-creation branch July 9, 2019 16:36
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.

3 participants