Class LastGrantedAuthoritiesProperty

java.lang.Object
hudson.model.UserProperty
jenkins.security.LastGrantedAuthoritiesProperty
All Implemented Interfaces:
ExtensionPoint, Describable<UserProperty>, ReconfigurableDescribable<UserProperty>

public class LastGrantedAuthoritiesProperty extends UserProperty
Remembers the set of GrantedAuthoritys that was obtained the last time the user has logged in. This allows us to implement User.impersonate2() with proper set of groups.
Since:
1.556
Author:
Kohsuke Kawaguchi
See Also:
  • Constructor Details

    • LastGrantedAuthoritiesProperty

      public LastGrantedAuthoritiesProperty()
  • Method Details

    • reconfigure

      public UserProperty reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException
      Stick to the same object since there's no UI for this.
      Specified by:
      reconfigure in interface ReconfigurableDescribable<UserProperty>
      Overrides:
      reconfigure in class UserProperty
      Parameters:
      req - The current HTTP request being processed.
      form - JSON fragment that corresponds to this describable object. If the newly submitted form doesn't include a fragment for this describable (meaning the user has de-selected your descriptor), then this argument is null.
      Returns:
      The new instance. To not to create an instance of a describable, return null.
      Throws:
      Descriptor.FormException
    • getAuthorities2

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities2()
      Since:
      2.266
    • getAuthorities

      @Deprecated public GrantedAuthority[] getAuthorities()
      Deprecated.
    • update

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void update(@NonNull org.springframework.security.core.Authentication auth) throws IOException
      Persist the information with the new UserDetails.
      Throws:
      IOException
    • invalidate

      public void invalidate() throws IOException
      Removes the recorded information
      Throws:
      IOException