Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new class for redirecting to self profile page
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageSelfProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2010-2015 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.web.page.self; | ||
|
||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.request.mapper.parameter.PageParameters; | ||
|
||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; | ||
import com.evolveum.midpoint.security.api.AuthorizationConstants; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.web.application.AuthorizationAction; | ||
import com.evolveum.midpoint.web.application.PageDescriptor; | ||
import com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb; | ||
import com.evolveum.midpoint.web.page.admin.roles.PageRole; | ||
|
||
@PageDescriptor(url = {"/self/profile/role"}, action = { | ||
@AuthorizationAction(actionUri = PageSelf.AUTH_SELF_ALL_URI, | ||
label = PageSelf.AUTH_SELF_ALL_LABEL, | ||
description = PageSelf.AUTH_SELF_ALL_DESCRIPTION), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_SELF_PROFILE_URL, | ||
label = "PageRoleSelfProfile.auth.profile.label", | ||
description = "PageRoleSelfProfile.auth.profile.description")}) | ||
public class PageSelfProfile extends PageRole { | ||
|
||
public PageSelfProfile() { | ||
super(); | ||
} | ||
|
||
public PageSelfProfile(PageParameters parameters) { | ||
super(parameters); | ||
} | ||
|
||
private static final long serialVersionUID = 1L; | ||
private static final Trace LOGGER = TraceManager.getTrace(PageSelfProfile.class); | ||
|
||
@Override | ||
protected String getObjectOidParameter() { | ||
return WebModelServiceUtils.getLoggedInFocusOid(); | ||
} | ||
|
||
@Override | ||
protected boolean isSelfProfile(){ | ||
return true; | ||
} | ||
|
||
@Override | ||
protected IModel<String> createPageTitleModel() { | ||
return createStringResource("PageAdmin.menu.profile"); | ||
} | ||
|
||
@Override | ||
protected void createBreadcrumb() { | ||
super.createBreadcrumb(); | ||
|
||
Breadcrumb bc = getLastBreadcrumb(); | ||
bc.setIcon(new Model(GuiStyleConstants.CLASS_OBJECT_ROLE_ICON)); | ||
} | ||
|
||
} |