0 Replies Latest reply on Aug 6, 2009 4:50 PM by Marco Röösli

    Enable,Disable a security Role

    Marco Röösli Newbie

      Is it possible to enable/disable a seam security Role?

      In my case I want to deactivate a role and I also wan't that permissions containing this role(recipient) are not be listed if I call listPermissions()

      After enable the role again I wan't that all permissions are listed when I call listPermissions()

      I have an Idea:
      Adding a boolean filed in my Role class which holds the status of the role (enabled/disabled)

      Adding a boolean field in my Permission class (enabled/disabled)

      And then I override the method createPermissionQuery() in the JpaPermissionStore and extend the query with my parameter for (enabled/disabled) permissions

      Then I need a method to enable/disable the role
      In this method I also set the flag in all Permissions containing this role.
      So if I disable the Role I also Disable all containing permissions.

      Is this a good way?
      Is there a better way?
      Is this a feature what is required in general?

      Thx for your help.
      Greetz Marco