Bug 48624 - Connect front and back end for the install permissions
Connect front and back end for the install permissions
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4
Assigned To: Dirk Wiesenthal
Erik Damrose
: interim-3
Depends on:
Blocks: 48753
  Show dependency treegraph
 
Reported: 2019-02-07 12:38 CET by Richard Ulmer
Modified: 2019-03-12 13:41 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ulmer univentionstaff 2019-02-07 12:38:23 CET
Make the back end (Bug #48605) deliver necessary information for the install permissions to the front end (Bug #48544). This means primarily to provide the attributes 'candidateVersion' (the appropriate one), 'candidateInstallIsPermitted' and 'buyReasons' for each App.
Comment 1 Dirk Wiesenthal univentionstaff 2019-02-12 01:20:01 CET
Does not work until the Docker Registries are set up. If you want to "test" it, monkey path python/appcenter-docker/docker.py:
  return False in the first line of access()

But actually tests the "connection". The docker login command is not tested.

ada529eb6cfca30085827cbb18d0c010a48a7e96 Bug #48605: Install permissions backend
972c0e23794690836dc84b4646040a4420b3f688 Bug #48605: Install permissions backend

I also made small adjustments in the frontend.
Comment 2 Richard Ulmer univentionstaff 2019-02-12 12:01:34 CET
> But actually tests the "connection".
I'm not sure what you mean by "the connection".
> The docker login command is not tested.
Is my understanding correct, that this cannot be tested right now? In this case I would like to wait for this to work, before verifying this bug.

This is what I have found until now:
WORKING:
- Installing a completely nonfree App is impossible, when the user has no permissions for it.
- Upgrading to a nonfree App is impossible, when the user has no permissions for it.
- The candidate versions is displayed correctly for installed Apps.
- Upgrading from one free version to another works as expected.
- The "Update" and "Fast Forward Update" symbols are displayed correctly (see below for an exception).

FAULTY:
1. You have changed the front end, so that now either `app.candidateInstallPermissionMessage` or `_('Buy %(appName)s to install version %(candidateVersion)s.'` is displayed. This is not the behavior described in the concept document. `app.candidateInstallPermissionMessage` is supposed to be displayed in addition to to the other text.

2. I removed an App, which had a free version and one that required permissions. After that the displayed (candidate) version was the one that required permissions, even though the user was not permitted to install it. The App could not be installed via the UMC. Installing via univention-app worked without a problem (the latest free version was automatically chosen). Also the "Fast Forward Update" symbol was displayed on the uninstalled App. 

(3.) Maybe `must_have_install_permissions` in umc/js/appcenter/requirements.js can be removed again. The user cannot click "upgrade", when the install is not permitted, thus the messages should never become visible.
Comment 3 Dirk Wiesenthal univentionstaff 2019-02-21 09:58:58 CET
(In reply to Richard Ulmer from comment #2)
> FAULTY:
> 1. You have changed the front end, so that now either
> `app.candidateInstallPermissionMessage` or `_('Buy %(appName)s to install
> version %(candidateVersion)s.'` is displayed. This is not the behavior
> described in the concept document. `app.candidateInstallPermissionMessage`
> is supposed to be displayed in addition to to the other text.

You are right. I fixed that...

> 
> 2. I removed an App, which had a free version and one that required
> permissions. After that the displayed (candidate) version was the one that
> required permissions, even though the user was not permitted to install it.
> The App could not be installed via the UMC. Installing via univention-app
> worked without a problem (the latest free version was automatically chosen).
> Also the "Fast Forward Update" symbol was displayed on the uninstalled App. 

Fixed.

> 
> (3.) Maybe `must_have_install_permissions` in
> umc/js/appcenter/requirements.js can be removed again. The user cannot click
> "upgrade", when the install is not permitted, thus the messages should never
> become visible.

Yes kind of. But I do not know how the App Center behaves if a requirement is not met, yet the requirement cannot be handled in the frontend. It may not be necessary, but it does not hurt, wither.
Comment 4 Erik Damrose univentionstaff 2019-02-26 12:04:49 CET
Verified
Comment 5 Florian Best univentionstaff 2019-03-12 13:41:12 CET
UCS 4.4 has been released:
 https://docs.software-univention.de/release-notes-4.4-0-en.html
 https://docs.software-univention.de/release-notes-4.4-0-de.html

If this error occurs again, please use "Clone This Bug".