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

Add preview? policy method #3513

Open
5 tasks
Paul-Bob opened this issue Dec 11, 2024 · 3 comments
Open
5 tasks

Add preview? policy method #3513

Paul-Bob opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
Enhancement Not necessarily a feature, but something has improved Stale exempt

Comments

@Paul-Bob
Copy link
Contributor

Paul-Bob commented Dec 11, 2024

Feature

Let's add a preview? policy method check that will control whenever the preview field is visible / not, and also when the request is authorized / not.

Also let's ensure that the preview generates a link to the record only when the record's show? is authorized.

  • Add preview? policy check
  • Verify show? to render link to record on preview field
  • Tests
  • Docs
  • Include a upgrade note for the breaking changes (preview only visible if authorized)
@Paul-Bob Paul-Bob self-assigned this Dec 11, 2024
@Paul-Bob Paul-Bob added the Enhancement Not necessarily a feature, but something has improved label Dec 11, 2024
@Paul-Bob Paul-Bob moved this to Next up in Issues Dec 11, 2024
@adrianthedev
Copy link
Collaborator

Also let's ensure that the preview generates a link to the record only when the record's show? is authorized

If show returns false, the preview field is rendered useless, no? It should be hidden too.
I wouldn't go into hiding it automatically and everything, but leave it to the developer to hide it manually if the user is not authorized.

@Paul-Bob
Copy link
Contributor Author

If show returns false, the preview field is rendered useless, no? It should be hidden too.

IMO preview and show are different. You can add 2 fields on preview and allow it for all users and restrict the show view to be visible only for admins.

I wouldn't go into hiding it automatically and everything, but leave it to the developer to hide it manually if the user is not authorized.

This is interesting, one question I have is: where would the developer manually hide it?

Copy link
Contributor

This issue has been marked as stale because there was no activity for the past 15 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not necessarily a feature, but something has improved Stale exempt
Projects
Status: Next up
Development

No branches or pull requests

2 participants