Package jenkins.security
Class LastGrantedAuthoritiesProperty
java.lang.Object
hudson.model.UserProperty
jenkins.security.LastGrantedAuthoritiesProperty
- All Implemented Interfaces:
ExtensionPoint
,Describable<UserProperty>
,ReconfigurableDescribable<UserProperty>
Remembers the set of
GrantedAuthority
s 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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static class
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
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Collection<? extends org.springframework.security.core.GrantedAuthority>
void
Removes the recorded informationreconfigure
(org.kohsuke.stapler.StaplerRequest2 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, allByCategoryClass, getDescriptor, reconfigure, setUser
-
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 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
- Since:
- 2.266
-
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
Removes the recorded information- Throws:
IOException
-
getAuthorities2()