View Javadoc
1   /*
2    * Copyright 2022 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
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  
17  package org.bremersee.acl.spring.data.mongodb.app;
18  
19  import java.util.Collection;
20  import java.util.Optional;
21  import org.bremersee.acl.AccessEvaluation;
22  import org.bremersee.acl.Acl;
23  import org.bremersee.acl.AclUserContext;
24  import org.bremersee.acl.model.AccessControlListModifications;
25  
26  /**
27   * The example entity repository custom.
28   *
29   * @author Christian Bremer
30   */
31  public interface ExampleEntityRepositoryCustom {
32  
33    /**
34     * Find by other content optional.
35     *
36     * @param otherContent the other content
37     * @param userContext the user context
38     * @param accessEvaluation the access evaluation
39     * @param permissions the permissions
40     * @return the optional
41     */
42    Optional<ExampleEntity> findByOtherContent(
43        String otherContent,
44        AclUserContext userContext,
45        AccessEvaluation accessEvaluation,
46        Collection<String> permissions);
47  
48    /**
49     * Modify acl by other content optional.
50     *
51     * @param otherContent the other content
52     * @param userContext the user context
53     * @param modifications the modifications
54     * @return the optional
55     */
56    Optional<ExampleEntity> modifyAclByOtherContent(
57        String otherContent,
58        AclUserContext userContext,
59        AccessControlListModifications modifications);
60  
61    /**
62     * Replace acl by other content optional.
63     *
64     * @param otherContent the other content
65     * @param newAcl the new acl
66     * @return the optional
67     */
68    Optional<ExampleEntity> replaceAclByOtherContent(String otherContent, Acl newAcl);
69  
70    /**
71     * Change owner by other content optional.
72     *
73     * @param otherContent the other content
74     * @param userContext the user context
75     * @param newOwner the new owner
76     * @return the optional
77     */
78    Optional<ExampleEntity> changeOwnerByOtherContent(
79        String otherContent,
80        AclUserContext userContext,
81        String newOwner);
82  
83  }