Wicket
  1. Wicket
  2. WICKET-5143

Create an interface for the roles replacing the current Roles class

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.8.0
    • Component/s: wicket-auth-roles
    • Labels:
      None

      Description

      Currently the roles in wicket are managed by a final class, Roles, that extends HashSet.
      In my current projects I have to manage permissions considering several factors that include the role, the creator and the type of data, and this must be done also when displaying tables with several rows. Having the possibility to create my own Roles class I can integrate my restrictions with wicket authorization and add some performance improvements (required in this case because the validation must be done at the field level).

      1. roles_changes.zip
        20 kB
        Nuno Jacinto

        Activity

        Hide
        Nuno Jacinto added a comment -

        Hello,

        Thank you. That will allow me to go on without having to change the original wicket code.

        I apologise for not creating the diff file yet. A little busy lately. I will try to do it next weekend and since you want it for version 7, I also need to see if there is something different in this part from the version 6.

        Cheers,
        Nuno

        Show
        Nuno Jacinto added a comment - Hello, Thank you. That will allow me to go on without having to change the original wicket code. I apologise for not creating the diff file yet. A little busy lately. I will try to do it next weekend and since you want it for version 7, I also need to see if there is something different in this part from the version 6. Cheers, Nuno
        Hide
        Martin Grigorov added a comment -

        I've removed 'final' for the class.
        Please create a new ticket with an attachment in .patch format if you prefer the interface based solution for Wicket 7+.

        Show
        Martin Grigorov added a comment - I've removed 'final' for the class. Please create a new ticket with an attachment in .patch format if you prefer the interface based solution for Wicket 7+.
        Hide
        Nuno Jacinto added a comment -

        Hello,

        I never done it before, but I will try to do it (so that next time I will do the things properly).
        The changes only affect the auth-roles project and is as simple as replacing the Roles by IRoles on the few classes. I'm not use to git but with svn you can see what changed so I image that git has something similar.
        I can send you also the code with the folders if it makes it easier.
        Anyway I will try to create the diff and attach it to the ticket.

        Thank you.

        Cheers,
        Nuno

        Show
        Nuno Jacinto added a comment - Hello, I never done it before, but I will try to do it (so that next time I will do the things properly). The changes only affect the auth-roles project and is as simple as replacing the Roles by IRoles on the few classes. I'm not use to git but with svn you can see what changed so I image that git has something similar. I can send you also the code with the folders if it makes it easier. Anyway I will try to create the diff and attach it to the ticket. Thank you. Cheers, Nuno
        Hide
        Martin Grigorov added a comment -

        Hi,

        Is it easy for you to send the changes in .patch/.diff format ?
        It will be easier to review them and apply them in the code base.
        Otherwise we can also apply them manually ...

        I'm not sure whether you've ran 'mvn install' locally. We use maven-clirr-plugin to check for binary incompatible changes in minor releases. I expect that Clirr will fail the build with the introduction of IRoles. I guess we can remove 'final' for 6.x and apply your proposed changes for 7.x (after review).

        Show
        Martin Grigorov added a comment - Hi, Is it easy for you to send the changes in .patch/.diff format ? It will be easier to review them and apply them in the code base. Otherwise we can also apply them manually ... I'm not sure whether you've ran 'mvn install' locally. We use maven-clirr-plugin to check for binary incompatible changes in minor releases. I expect that Clirr will fail the build with the introduction of IRoles. I guess we can remove 'final' for 6.x and apply your proposed changes for 7.x (after review).
        Hide
        Nuno Jacinto added a comment -

        The attached file contains the changes required. Hopefully I cover all the files. I named the interface IRoles (I think it follows your strategy on names) but please give whatever name you see fit. I extend the interface with IClustered, as it was on the class Roles, and added the interface Collection<String>. Maybe it was necessary to add all methods of Collection but this way I hope to minimize any possible changes on existing projects. Please let me know if it requires more changes or if you make changes so that I can update my local code. Thank you.

        Show
        Nuno Jacinto added a comment - The attached file contains the changes required. Hopefully I cover all the files. I named the interface IRoles (I think it follows your strategy on names) but please give whatever name you see fit. I extend the interface with IClustered, as it was on the class Roles, and added the interface Collection<String>. Maybe it was necessary to add all methods of Collection but this way I hope to minimize any possible changes on existing projects. Please let me know if it requires more changes or if you make changes so that I can update my local code. Thank you.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Nuno Jacinto
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development