01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.repository.commonimpl.acl;
17:
18: import org.outerj.daisy.repository.commonimpl.AuthenticatedUser;
19: import org.outerj.daisy.repository.commonimpl.DocId;
20: import org.outerj.daisy.repository.Document;
21: import org.outerj.daisy.repository.RepositoryException;
22: import org.outerj.daisy.repository.VariantKey;
23: import org.outerj.daisy.repository.acl.AclResultInfo;
24: import org.outerj.daisy.repository.acl.AclPermission;
25:
26: /**
27: * Allows to customise the behaviour of the abstract implementation classes of the
28: * repository ACL API.
29: *
30: * <p>For (important) general information about this and other strategy interfaces, see also
31: * {@link org.outerj.daisy.repository.commonimpl.DocumentStrategy}.
32: */
33: public interface AclStrategy {
34: public static final long LIVE_ACL_ID = 1;
35: public static final long STAGING_ACL_ID = 2;
36:
37: public AclImpl loadAcl(long id, AuthenticatedUser user)
38: throws RepositoryException;
39:
40: public void storeAcl(AclImpl acl) throws RepositoryException;
41:
42: public void copyStagingToLive(AuthenticatedUser user)
43: throws RepositoryException;
44:
45: public void copyLiveToStaging(AuthenticatedUser user)
46: throws RepositoryException;
47:
48: public AclResultInfo getAclInfo(AuthenticatedUser user, long id,
49: long userId, long[] roleIds, Document document)
50: throws RepositoryException;
51:
52: public AclResultInfo getAclInfo(AuthenticatedUser user, long id,
53: long userId, long[] roleIds, DocId docId, long branchId,
54: long languageId) throws RepositoryException;
55:
56: // TODO VARIANTS: add branch and language here
57: public long[] filterDocumentTypes(AuthenticatedUser user,
58: long[] documentTypeIds, long collectionId)
59: throws RepositoryException;
60:
61: public VariantKey[] filterDocuments(AuthenticatedUser user,
62: VariantKey[] variantKeys, AclPermission permission,
63: boolean nonLive) throws RepositoryException;
64: }
|