Snipe-it: License is linked to Asset+User instead of Asset only when Asset is checked out to User already

Created on 1 Apr 2020  路  13Comments  路  Source: snipe/snipe-it

Please confirm you have done the following before posting your bug report:

Describe the bug
When I check out an asset to a user, then check out a license to that asset and then check in the asset again, the license is still linked to the user.

Use case: An employee is using a laptop. Software gets installed to the machine, let's say Photoshop. The user is not using the laptop anymore. Photoshop should be still linked to the machine, but not to the user anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Select an asset (A)
  2. Assign it to a user (U)
  3. Assign a license (L) to A
  4. Check A back in from U
  5. L is linked to A, but also still to U

Expected behavior

  1. Select an asset (A)
  2. Assign it to a user (U)
  3. Assign a license (L) to A
  4. Check A back in from U
  5. L is only linked to A and not to U

This behaviour is independent from any OS, Browser, PHP-Version, etc.

All 13 comments

I can confirm this behavior.
It's also worth noting that license behavior varies wildly depending on the software vendor. For example, we have licenses that can ONLY be assigned to hardware, licenses that can ONLY be assigned to users, and licenses that are assigned to the user AND hardware.

This appears to be an order of operations issue.

If you assign the asset to a user first, then assign the license, the behavior is as seen above. This is reflected in the GUI.
However, if you assign the license to the asset before the asset is assigned to the user, the license never gains any user information.
This is suboptimal as software licenses are often assigned after an asset is already deployed.

This:
image
vs. this:
image

+1 this causes a lot of confusion over time, when you check assets back in and assign them to new users. the license remains assigned to the original user.

if we had this feature https://github.com/snipe/snipe-it/issues/6695 then it would be possible to adjust (or clear) the user field via cronjob

Yea, makes sense. But that's additional effort which is in this case unnecessary I think.

Just removing the link the the user when an asset is checked out already would probably be the easiest. I don't really see the advantage of the current behaviour :/

@SpearRIT
I solved the problem for me by commenting out these lines in the "LicensesController.php" (app->Http->Controllers):

if ($target->checkedOutToUser()) {
    $licenseSeat->assigned_to =  $target->assigned_to;
}

Should be somewhere around line 332-334. Have it running for more then one week now and no problems so far. This avoids, that the license gets linked to the user at all, when you select "check out to asset". Good luck ;)

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

yup.

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

Still relevant.

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

I just came across this issue, it seems to relate very closesly to #7629 which speaks about the knock on effect of this - when an asset is checked in, any attached licenses remain allocated to the user and do not get disassociated.

Changing the behaviour described in this issue would actually resolve #7629

So I thought about this a bit more and its a bit of a grey area.
On the one hand, when you allocate a license to an asset, then if you allocate that asset to a user, you would not expect the license to be associated with the user at all.
On the other hand, it is nice to be able to see what licenses a user has access to while an asset is checked out to them.

I decided to go with the proposal in #7629 and disassociate all asset licences from a user when the asset gets checked in, and associate all asset licenses with the new user when an asset gets checked out.

I have submitted a pull request on #7629 - if it gets accepted, it will resolve the problem described in this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbradsha picture tbradsha  路  4Comments

snipe picture snipe  路  5Comments

jblandin04 picture jblandin04  路  5Comments

bricelabelle picture bricelabelle  路  3Comments

Rungea96 picture Rungea96  路  4Comments