Package jenkins.security
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 ofGrantedAuthority
s that was obtained the last time the user has logged in. This allows us to implementUser.impersonate2()
with proper set of groups.- Since:
- 1.556
- Author:
- Kohsuke Kawaguchi
- See Also:
ImpersonatingUserDetailsService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LastGrantedAuthoritiesProperty.DescriptorImpl
static class
LastGrantedAuthoritiesProperty.SecurityListenerImpl
Listen to the login success/failure event to persistGrantedAuthority
s properly.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.UserProperty
user
-
-
Constructor Summary
Constructors Constructor Description LastGrantedAuthoritiesProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GrantedAuthority[]
getAuthorities()
Deprecated.Collection<? extends org.springframework.security.core.GrantedAuthority>
getAuthorities2()
void
invalidate()
Removes the recorded informationUserProperty
reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form)
Stick to the same object since there's no UI for this.void
update(org.springframework.security.core.Authentication auth)
Persist the information with the newUserDetails
.-
Methods inherited from class hudson.model.UserProperty
all, getDescriptor, setUser
-
-
-
-
Method Detail
-
reconfigure
public UserProperty reconfigure(org.kohsuke.stapler.StaplerRequest 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 interfaceReconfigurableDescribable<UserProperty>
- Overrides:
reconfigure
in classUserProperty
- 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 newUserDetails
.- Throws:
IOException
-
invalidate
public void invalidate() throws IOException
Removes the recorded information- Throws:
IOException
-
-