mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- New public service method added to AuthenticationService component stack: guestUserAuthenticationAllowed() git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4981 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,6 +40,7 @@ import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
import org.alfresco.service.cmr.repository.TemplateNode;
|
||||
import org.alfresco.service.cmr.rule.RuleService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.web.app.Application;
|
||||
@@ -58,6 +59,10 @@ import org.alfresco.web.ui.repo.component.shelf.UIShelf;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Bean providing access and management of the various global navigation mechanisms
|
||||
* such as the My Home, Company Home, Guest Home toolbar shortcuts, breadcrumb and
|
||||
* the current node id and associated properties.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class NavigationBean
|
||||
@@ -134,6 +139,14 @@ public class NavigationBean
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authService The AuthenticationService to set.
|
||||
*/
|
||||
public void setAuthenticationService(AuthenticationService authService)
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the User object representing the current instance for this user
|
||||
*/
|
||||
@@ -678,10 +691,17 @@ public class NavigationBean
|
||||
* @return true if the Guest home node is accessable to the current user
|
||||
*/
|
||||
public boolean getGuestHomeVisible()
|
||||
{
|
||||
if (this.authService.guestUserAuthenticationAllowed())
|
||||
{
|
||||
Node guestHome = getGuestHomeNode();
|
||||
return guestHome != null && guestHome.hasPermission(PermissionService.READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
@@ -895,6 +915,9 @@ public class NavigationBean
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
|
||||
/** The Authentication service bean reference */
|
||||
protected AuthenticationService authService;
|
||||
|
||||
/** Cached path to our CIFS server and top level node DIR */
|
||||
private String cifsServerPath;
|
||||
|
||||
|
@@ -68,6 +68,10 @@
|
||||
<property-name>userPreferencesBean</property-name>
|
||||
<value>#{UserPreferencesBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>authenticationService</property-name>
|
||||
<value>#{AuthenticationService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
|
Reference in New Issue
Block a user