Skip to content

Commit

Permalink
fix for remove password button on focus pages (MID-6201)
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed May 29, 2020
1 parent f5ce5fe commit 04c1f5b
Show file tree
Hide file tree
Showing 3 changed files with 422 additions and 422 deletions.
Expand Up @@ -15,6 +15,7 @@
import com.evolveum.midpoint.prism.crypto.EncryptionException;
import com.evolveum.midpoint.prism.crypto.Protector;
import com.evolveum.midpoint.util.exception.SystemException;
import com.evolveum.midpoint.web.page.admin.PageAdminFocus;
import com.evolveum.midpoint.web.page.admin.users.PageUser;
import com.evolveum.midpoint.web.page.self.*;
import com.evolveum.midpoint.web.security.MidPointApplication;
Expand Down Expand Up @@ -193,7 +194,7 @@ public boolean isVisible() {
|| pageBase instanceof PageRoleSelfProfile || pageBase instanceof PageServiceSelfProfile) {
return false;
}
if (pageBase instanceof PageUser && !((PageUser) pageBase).isLoggedInUserPage()
if (pageBase instanceof PageAdminFocus && !((PageAdminFocus) pageBase).isLoggedInFocusPage()
&& model.getObject() != null){
return true;
}
Expand Down
Expand Up @@ -863,4 +863,10 @@ protected boolean isFocusHistoryPage(){
protected boolean isSelfProfile(){
return false;
}

public boolean isLoggedInFocusPage(){
return getObjectWrapper() != null && getObjectWrapper().getObject() != null &&
org.apache.commons.lang3.StringUtils.isNotEmpty(getObjectWrapper().getObject().asObjectable().getOid()) &&
getObjectWrapper().getObject().asObjectable().getOid().equals(WebModelServiceUtils.getLoggedInFocusOid());
}
}

0 comments on commit 04c1f5b

Please sign in to comment.