- Added action evaluator to start workflow action so the guest user can not start workflows

- Handled the case in the start workflow wizard where there are no workflows to start (info message displayed)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3667 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-09-04 09:57:29 +00:00
parent 42b84cb75c
commit be07f90d50
6 changed files with 83 additions and 2 deletions

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - Start workflow on a node.
*
* @author gavinc
*/
public class StartWorkflowEvaluator implements ActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
NavigationBean nav =
(NavigationBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "NavigationBean");
return (nav.getIsGuest() == false);
}
}

View File

@@ -447,6 +447,17 @@ public class StartWorkflowWizard extends BaseWizardBean
new String[] {workflowName});
}
/**
* Determines whether there are any workflows to start
* @return
*/
public boolean getHasStartableWorkflows()
{
// get the list of startable workflow, this will intialise the list if necessary
List<SelectItem> workflows = getStartableWorkflows();
return (workflows.size() > 0);
}
/**
* Returns a list of workflows that can be started.
*