Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2567

Upgrading a plugin adds permissions for only one company

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9.1, 4.10.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      When a plugin is upgraded, all instances of the plugin on other companies are also upgraded since they share database tables. New permissions however are only added for the instance upgraded. This should be updated to add the permission for all plugin instances.

        Activity

        Hide
        abdy Abdy Franco added a comment - - edited

        This new method will be similar to install() or upgrade() it will only receive plugin_id as the parameter and will return an array of all the plugin permissions, the plugin manager should be updated as well, as will need to add the permissions during installation and check what new permissions should be added on upgrade as well for all companies.

        Show
        abdy Abdy Franco added a comment - - edited This new method will be similar to install() or upgrade() it will only receive plugin_id as the parameter and will return an array of all the plugin permissions, the plugin manager should be updated as well, as will need to add the permissions during installation and check what new permissions should be added on upgrade as well for all companies.
        Hide
        jonathan Jonathan Reissmueller added a comment -

        I see. Well in that case I don't think there is any need to make this backward incompatible. It is simple enough to create a default method on the Plugin class that returns an empty array. Then all plugins that don't implement the method will continue to function in the current fashion.

        Is there a need for the $plugin_id parameter? It is just getting a list of permissions, yes?

        We'll also probably want to remove the permissions on uninstall. Upgrade should check permissions on every instance of the plugin, while install and uninstall should only effect the particular plugin the action is being taken on.

        Do we have what we need to get started on this? I'd love to get 4.9.1 out by the end of the week.

        Show
        jonathan Jonathan Reissmueller added a comment - I see. Well in that case I don't think there is any need to make this backward incompatible. It is simple enough to create a default method on the Plugin class that returns an empty array. Then all plugins that don't implement the method will continue to function in the current fashion. Is there a need for the $plugin_id parameter? It is just getting a list of permissions, yes? We'll also probably want to remove the permissions on uninstall. Upgrade should check permissions on every instance of the plugin, while install and uninstall should only effect the particular plugin the action is being taken on. Do we have what we need to get started on this? I'd love to get 4.9.1 out by the end of the week.
        Hide
        abdy Abdy Franco added a comment -

        I think we can remove the $plugin_id parameter as the method will only return a list of permissions, I see it possible to have it ready by the end of the week.

        Show
        abdy Abdy Franco added a comment - I think we can remove the $plugin_id parameter as the method will only return a list of permissions, I see it possible to have it ready by the end of the week.
        Hide
        jonathan Jonathan Reissmueller added a comment -

        I've got some time this afternoon so I'll go ahead and pick this one up and let you focus on filtering

        Show
        jonathan Jonathan Reissmueller added a comment - I've got some time this afternoon so I'll go ahead and pick this one up and let you focus on filtering
        Hide
        abdy Abdy Franco added a comment - - edited

        If you need help on the task, just let me know.

        Show
        abdy Abdy Franco added a comment - - edited If you need help on the task, just let me know.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/Apr/20

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 6 hours, 49 minutes
              6h 49m

                Agile