-
Notifications
You must be signed in to change notification settings - Fork 105
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
Users without the Publish Permission on a namespace can see the Publish button #2243
Comments
Will take a look. |
Replicated. Also worth noting, clicking the Publish button does bring up the warning modal, and accepting the modal does strictly nothing. |
Looks like the GET call to
... which subsequently allows showing the Publish button. There might be something wrong with that. |
I guess the issue is that the PolicyEntry DTO returned by that controller does not convey the required information on the "tenant user"'s roles for that namespace, which is the one that would have sufficient granularity to differentiate between single buttons such as the "Publish" one. Not sure if there's an easy way to change that without breaking things, will need some more research. |
We have an existing REST endpoint that does not look like it's being used at all:
A call to this would return the namespace user ("tenant user") permissions (which we somehow ended up calling "roles"). Can probably cook up some POC for this, although I will have to think harder in order to have only one REST call within context, before considering for merge. |
Discovered what seems to be a related bug, albeit cosmetic: a non-private namespace owner is not advertised to have the right to publish (although they obviously have the manage right). Suspect the right to publish is implicitly derived from the higher manage privilege, or somehow derived from the namespace ownership any other way, since owners can obviously publish models in their own ns. It still leads to weird situations where it looks like lambda users may have the right to publish whereas owners do not in appearance. See example below:
TL;DR Will see if I can bundle a fix for this within this task (as it's more of a cosmetic bug) - otherwise will open another ticket... Edit I think the fix for the main task deprecates this issue. |
Another somehow related bug (this last one might have been introduced by myself with #2208 or more probably, #2088: the first time one adds a user to a namespace, the permission fields are not sent to the back-end, which results in the PUT request failing and the front-end stating "You cannot change your own permission" (completely unrelated) as a boilerplate error message. Edit this one is still valid and I've formalized it in #2247. |
Back to this specific issue, the However, the policy DTO seems to return the "best" policy for that user for that model. Note that so far however, updates on a current user for a given namespace do not seem to work, even after logging the user off and back in. |
And another note on the above: the REST endpoint already exists - hadn't spotted it at first. |
PR here. @aedelmann if time allows, could you advise on whether lowering the pre-authorization for the endpoint in question constitutes a risk I don't understand, or is it good to go as is? |
@kolotu since the PR is merged, I think you can close this. |
Users that do not have PUBLISH permission can see the publish button on the details view. Nothing happens when the user clicks on the button, but it should not be visible to them in the first place.
The text was updated successfully, but these errors were encountered: