001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019package org.apache.isis.extensions.secman.api.tenancy;
020
021
022/**
023 * Role interface for domain objects to implement, indicating that these are characteristics of the entity that
024 * can be used to determine its visibility/editability.
025 *
026 * <p>
027 *     Previously the <code>atPath</code> would have corresponded to the unique path of some particular
028 *     {@link org.apache.isis.extensions.secman.jdo.dom.tenancy.ApplicationTenancy} instance.  However, this has now been
029 *     generalized; the atPath is simply a string whose interpretation is application-specific (in particular by
030 *     the {@link ApplicationTenancyEvaluator} SPI).
031 * </p>
032 *
033 * <p>
034 * For applications that still wish to follow the original more specific design (that the <code>atPath</code>
035 * corresponds to a single {@link ApplicationTenancy}), then the path can be interpreted according to the following
036 * table:
037 * </p>
038 * <table border="1">
039 *     <tr>
040 *         <th>object's tenancy</th><th>user's tenancy</th><th>access</th>
041 *     </tr>
042 *     <tr>
043 *         <td>null</td><td>null</td><td>editable</td>
044 *     </tr>
045 *     <tr>
046 *         <td>null</td><td>non-null</td><td>editable</td>
047 *     </tr>
048 *     <tr>
049 *         <td>/</td><td>/</td><td>editable</td>
050 *     </tr>
051 *     <tr>
052 *         <td>/</td><td>/it</td><td>visible</td>
053 *     </tr>
054 *     <tr>
055 *         <td>/</td><td>/it/car</td><td>visible</td>
056 *     </tr>
057 *     <tr>
058 *         <td>/</td><td>/it/igl</td><td>visible</td>
059 *     </tr>
060 *     <tr>
061 *         <td>/</td><td>/fr</td><td>visible</td>
062 *     </tr>
063 *     <tr>
064 *         <td>/</td><td>null</td><td>not visible</td>
065 *     </tr>
066 *     <tr>
067 *         <td>/it</td><td>/</td><td>editable</td>
068 *     </tr>
069 *     <tr>
070 *         <td>/it</td><td>/it</td><td>editable</td>
071 *     </tr>
072 *     <tr>
073 *         <td>/it</td><td>/it/car</td><td>visible</td>
074 *     </tr>
075 *     <tr>
076 *         <td>/it</td><td>/it/igl</td><td>visible</td>
077 *     </tr>
078 *     <tr>
079 *         <td>/it</td><td>/fr</td><td>not visible</td>
080 *     </tr>
081 *     <tr>
082 *         <td>/it</td><td>null</td><td>not visible</td>
083 *     </tr>
084 *     <tr>
085 *         <td>/it/car</td><td>/</td><td>editable</td>
086 *     </tr>
087 *     <tr>
088 *         <td>/it/car</td><td>/it</td><td>editable</td>
089 *     </tr>
090 *     <tr>
091 *         <td>/it/car</td><td>/it/car</td><td>editable</td>
092 *     </tr>
093 *     <tr>
094 *         <td>/it/car</td><td>/it/igl</td><td>not visible</td>
095 *     </tr>
096 *     <tr>
097 *         <td>/it/car</td><td>/fr</td><td>not visible</td>
098 *     </tr>
099 *     <tr>
100 *         <td>/it/car</td><td>null</td><td>not visible</td>
101 *     </tr>
102 * </table>
103 * <p>any object that is not tenanted (that is, its class does not implement {@link HasAtPath the WithApplicationTenancy interface} is accessible by any user (usual permission rules apply).
104 * </p>
105 */
106public interface HasAtPath {
107
108    String getAtPath();
109
110}