Fixed ALF-3085: UI Bootstrap - No root 'Web Projects' folder exists (is WCM enabled ?)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22904 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-10-06 08:46:11 +00:00
parent c69d0afbf8
commit fdfcd61b65

View File

@@ -1,19 +1,19 @@
/* /*
* Copyright (C) 2005-2010 Alfresco Software Limited. * Copyright (C) 2005-2010 Alfresco Software Limited.
* *
* This file is part of Alfresco * This file is part of Alfresco
* *
* Alfresco is free software: you can redistribute it and/or modify * Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* Alfresco is distributed in the hope that it will be useful, * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.alfresco.web.action.evaluator; package org.alfresco.web.action.evaluator;
@@ -65,6 +65,12 @@ public class RegenerateRenditionsEvaluator extends BaseActionEvaluator
final WebProjectService webProjectService = services.getWebProjectService(); final WebProjectService webProjectService = services.getWebProjectService();
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME); final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// before looking for web projects ensure the root folder is present i.e. WCM is enabled!
if (!webProjectService.hasWebProjectsRoot())
{
return false;
}
// check that the authenticated user has CONTENT MANAGER permissions for at least one web project // check that the authenticated user has CONTENT MANAGER permissions for at least one web project
// this will ensure that the action appears only if the user is able to regenerate renditions // this will ensure that the action appears only if the user is able to regenerate renditions
// for at least one web project // for at least one web project