#
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
#  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.
#

# CMS root paths
add mixin sling:Redirect to /
set properties on /
  set sling:resourceType{String} to sling:redirect
  set sling:target{String} to /cms/start.html
end
create path (sling:Folder) /etc/i18n
set ACL for everyone
    allow   jcr:read	on /etc/i18n
end
create path (sling:Folder) /etc/taxonomy
set ACL for everyone
    allow   jcr:read	on /etc/taxonomy
end
create path (sling:Folder) /static
set ACL for everyone
    allow   jcr:read	on /static
end
create path (sling:Folder) /conf
set ACL for everyone
    allow   jcr:read	on /conf
end
create path (sling:Folder) /content
create path (sling:Folder) /etc/usergenerated
set ACL for everyone
    allow   jcr:read    on /etc/usergenerated
end

# Groups
create path (rep:AuthorizableFolder) /home/groups
create path (rep:AuthorizableFolder) /home/groups/sling-cms
create group administrators with path sling-cms
set ACL for administrators
    allow   jcr:all    on /
end
create group authors with path sling-cms
set ACL for authors
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /content
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /static
    allow   jcr:read    on /
end
create group job-users with path sling-cms
create group taxonomy-users with path sling-cms
set ACL for taxonomy-users
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /etc/taxonomy
end
create group ugc-users with path sling-cms
set ACL for ugc-users
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /etc/usergenerated
end

# Service users
create service user sling-cms-metadata
set ACL for sling-cms-metadata
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /content
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /static
    allow   jcr:read    on /
end
create service user sling-cms-transformer
set ACL for sling-cms-transformer
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /content
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /static
    allow   jcr:read    on /
end
create service user sling-cms-ugc
set ACL for sling-cms-ugc
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /etc/usergenerated
end
create service user sling-cms-versionmgr
set ACL for sling-cms-versionmgr
    allow   jcr:write,jcr:nodeTypeManagement,jcr:versionManagement    on /
    allow   jcr:read    on /jcr:system/jcr:versionStorage
end

# Namespaces
register namespace (acdsee) "http://ns.acdsee.com/iptc/1.0/"
register namespace (album) "http://ns.adobe.com/album/1.0/"
register namespace (cc) "http://creativecommons.org/ns#"
register namespace (crs) "http://ns.adobe.com/camera-raw-settings/1.0/"
register namespace (dc) "http://purl.org/dc/elements/1.1/"
register namespace (dcterms) "http://purl.org/dc/terms/"
register namespace (Iptc4xmpCore) "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
register namespace (lr) "http://ns.adobe.com/lightroom/1.0/"
register namespace (mediapro) "http://ns.iview-multimedia.com/mediapro/1.0/"
register namespace (MP) "http://ns.microsoft.com/photo/1.2/"
register namespace (photoshop) "http://ns.adobe.com/photoshop/1.0/"
register namespace (plus) "http://ns.useplus.org/ldf/xmp/1.0/"
register namespace (pdf) "http://ns.adobe.com/pdf/1.3/"
register namespace (pdfx) "http://ns.adobe.com/pdfx/1.3/"
register namespace (prism) "http://prismstandard.org/namespaces/basic/2.1/"
register namespace (prl) "http://prismstandard.org/namespaces/prl/2.1/"
register namespace (psAux) "http://ns.adobe.com/exif/1.0/aux/"
register namespace (rdf) "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
register namespace (stEvt) "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
register namespace (stEvt) "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
register namespace (tiff) "http://ns.adobe.com/tiff/1.0/"
register namespace (xmp) "http://ns.adobe.com/xap/1.0/"
register namespace (xmpBJ) "http://ns.adobe.com/xap/1.0/bj/"
register namespace (xmpDM) "http://ns.adobe.com/xmp/1.0/DynamicMedia/"
register namespace (xmpMM) "http://ns.adobe.com/xap/1.0/mm/"
register namespace (xmpNote) "http://ns.adobe.com/xmp/note/"
register namespace (xmpPLUS) "http://ns.adobe.com/xap/1.0/PLUS/"
register namespace (xmpRights) "http://ns.adobe.com/xap/1.0/rights/"
register namespace (xmpTPg) "http://ns.adobe.com/xap/1.0/t/pg/"

