From ee7843b2f18b846ff58bf92118224c5686c7a112 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Mon, 18 Feb 2008 11:58:54 +0000 Subject: [PATCH] Added permission model bootstrap bean, added mediaWiki cusomt permission model, updated UI wizards to use custom permission models for derived types, added PHP mimetype git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8303 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../public-services-security-context.xml | 8 +++ .../impl/model/PermissionModel.java | 10 +++ .../impl/model/PermissionModelBootstrap.java | 68 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModelBootstrap.java diff --git a/config/alfresco/public-services-security-context.xml b/config/alfresco/public-services-security-context.xml index 9739681b41..6d019ee03d 100644 --- a/config/alfresco/public-services-security-context.xml +++ b/config/alfresco/public-services-security-context.xml @@ -113,6 +113,14 @@ + + + + + + + + diff --git a/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModel.java b/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModel.java index 867647bc09..3aa69f0a27 100644 --- a/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModel.java +++ b/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModel.java @@ -157,6 +157,16 @@ public class PermissionModel implements ModelDAO, InitializingBean */ public void afterPropertiesSet() + { + addPermissionModel(this.model); + } + + /** + * Adds a permission model + * + * @param model path to the permission model to add + */ + public void addPermissionModel(String model) { Document document = createDocument(model); Element root = document.getRootElement(); diff --git a/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModelBootstrap.java b/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModelBootstrap.java new file mode 100644 index 0000000000..4f8bc40ded --- /dev/null +++ b/source/java/org/alfresco/repo/security/permissions/impl/model/PermissionModelBootstrap.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.repo.security.permissions.impl.model; + +/** + * Bootstrap bean used to add additional permission models + * + * @author Roy Wetherall + */ +public class PermissionModelBootstrap +{ + /** Permission model */ + private PermissionModel permissionModel; + + /** Path to the permission model */ + private String model; + + /** + * Set the permission model + * + * @param permissionModel the permission model + */ + public void setPermissionModel(PermissionModel permissionModel) + { + this.permissionModel = permissionModel; + } + + /** + * Sets the path to the permission model + * + * @param model path to the permission model + */ + public void setModel(String model) + { + this.model = model; + } + + /** + * Initialise method that adds the permission models + */ + public void init() + { + // Initialise the permission model + this.permissionModel.addPermissionModel(this.model); + } +}