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

Incorrect display of permissions in permission testing tool #2278

Closed
simonw opened this issue Feb 19, 2024 · 2 comments
Closed

Incorrect display of permissions in permission testing tool #2278

simonw opened this issue Feb 19, 2024 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Feb 19, 2024

Screenshot of https://latest.datasette.io/-/permissions

CleanShot 2024-02-19 at 11 22 08@2x

@simonw
Copy link
Owner Author

simonw commented Feb 19, 2024

Template code:

<select name="permission" id="permission">
{% for permission in permissions %}
<option value="{{ permission.0 }}">{{ permission.name }} (default {{ permission.default }})</option>
{% endfor %}
</select>

View:

return await self.render(
["permissions_debug.html"],
request,
# list() avoids error if check is performed during template render:
{
"permission_checks": list(reversed(self.ds._permission_checks)),
"permissions": [
(
p.name,
p.abbr,
p.description,
p.takes_database,
p.takes_resource,
p.default,
)
for p in self.ds.permissions.values()
],
},
)

@simonw simonw added this to the 1.0a11 milestone Feb 19, 2024
@simonw simonw closed this as completed in 2630073 Feb 19, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 19, 2024

debug-tool

simonw added a commit that referenced this issue Feb 19, 2024
simonw added a commit that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant