- 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:
Kevin Roast
2007-01-31 14:25:45 +00:00
parent 5cdfa838d9
commit 228bf2e5b2
2 changed files with 29 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ import org.alfresco.service.cmr.repository.TemplateImageResolver;
import org.alfresco.service.cmr.repository.TemplateNode; import org.alfresco.service.cmr.repository.TemplateNode;
import org.alfresco.service.cmr.rule.RuleService; import org.alfresco.service.cmr.rule.RuleService;
import org.alfresco.service.cmr.search.SearchService; 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.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
@@ -58,6 +59,10 @@ import org.alfresco.web.ui.repo.component.shelf.UIShelf;
import org.apache.log4j.Logger; 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 * @author Kevin Roast
*/ */
public class NavigationBean public class NavigationBean
@@ -134,6 +139,14 @@ public class NavigationBean
this.preferences = preferences; 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 * @return the User object representing the current instance for this user
*/ */
@@ -679,8 +692,15 @@ public class NavigationBean
*/ */
public boolean getGuestHomeVisible() public boolean getGuestHomeVisible()
{ {
Node guestHome = getGuestHomeNode(); if (this.authService.guestUserAuthenticationAllowed())
return guestHome != null && guestHome.hasPermission(PermissionService.READ); {
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 */ /** The user preferences bean reference */
protected UserPreferencesBean preferences; protected UserPreferencesBean preferences;
/** The Authentication service bean reference */
protected AuthenticationService authService;
/** Cached path to our CIFS server and top level node DIR */ /** Cached path to our CIFS server and top level node DIR */
private String cifsServerPath; private String cifsServerPath;

View File

@@ -68,6 +68,10 @@
<property-name>userPreferencesBean</property-name> <property-name>userPreferencesBean</property-name>
<value>#{UserPreferencesBean}</value> <value>#{UserPreferencesBean}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>authenticationService</property-name>
<value>#{AuthenticationService}</value>
</managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>