Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 29, 2022
2 parents 613bc03 + c61d881 commit 7efce5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -76,7 +77,7 @@ public class GuiProfiledPrincipalManagerImpl implements CacheListener, GuiProfil

private static final Trace LOGGER = TraceManager.getTrace(GuiProfiledPrincipalManagerImpl.class);

private static final Set<ItemPath> ASSIGNMENTS_AND_ADMIN_GUI_PATHS = ImmutableSet.of(FocusType.F_ASSIGNMENT, RoleType.F_ADMIN_GUI_CONFIGURATION);
private static final Set<ItemPath> ASSIGNMENTS_AND_ADMIN_GUI_PATHS = ImmutableSet.of(FocusType.F_ASSIGNMENT, RoleType.F_ADMIN_GUI_CONFIGURATION, FocusType.F_ACTIVATION);
private static final Set<ChangeType> MODIFY_DELETE_CHANGES = CacheInvalidationEventSpecification.MODIFY_DELETE;

private static final Collection<CacheInvalidationEventSpecification> CACHE_EVENT_SPECIFICATION =
Expand Down Expand Up @@ -429,6 +430,15 @@ public <O extends ObjectType> void invalidate(Class<O> type, String oid, boolean
try {
focus = repositoryService.getObject(principal.getFocus().getClass(), focusOid, null, result);
principal.replaceFocus(focus.asObjectable());
if (!principal.isEnabled()) {
// User is disabled
var terminate = new TerminateSessionEvent();
terminate.setPrincipalOids(Collections.singletonList(principal.getOid()));
terminateLocalSessions(terminate);
// Do not recompute profile
return principal.getCompiledGuiProfile();
}

} catch (ObjectNotFoundException e) {
throw new SystemException("Focus was deleted");
} catch (SchemaException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public FocusType getFocus() {

public void replaceFocus(FocusType newFocus) {
focus = newFocus;
// Efective activation status is derived from focus and its cached
effectiveActivationStatus = null;
}

public PolyStringType getName() {
Expand Down

0 comments on commit 7efce5e

Please sign in to comment.