KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > permissions > noop > PermissionServiceNOOPImpl


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.permissions.noop;
18
19 import java.util.HashSet JavaDoc;
20 import java.util.Set JavaDoc;
21
22 import org.alfresco.repo.security.permissions.NodePermissionEntry;
23 import org.alfresco.repo.security.permissions.PermissionEntry;
24 import org.alfresco.repo.security.permissions.PermissionReference;
25 import org.alfresco.repo.security.permissions.PermissionServiceSPI;
26 import org.alfresco.service.cmr.repository.NodeRef;
27 import org.alfresco.service.cmr.security.AccessPermission;
28 import org.alfresco.service.cmr.security.AccessStatus;
29 import org.alfresco.service.namespace.QName;
30
31
32 /**
33  * Dummy implementation of Permissions Service
34  *
35  */

36 public class PermissionServiceNOOPImpl
37     implements PermissionServiceSPI
38 {
39     
40     /* (non-Javadoc)
41      * @see org.alfresco.repo.security.permissions.PermissionService#getOwnerAuthority()
42      */

43     public String JavaDoc getOwnerAuthority()
44     {
45         return OWNER_AUTHORITY;
46     }
47
48     /* (non-Javadoc)
49      * @see org.alfresco.repo.security.permissions.PermissionService#getAllAuthorities()
50      */

51     public String JavaDoc getAllAuthorities()
52     {
53         return ALL_AUTHORITIES;
54     }
55
56     /* (non-Javadoc)
57      * @see org.alfresco.repo.security.permissions.PermissionService#getAllPermission()
58      */

59     public String JavaDoc getAllPermission()
60     {
61         return ALL_PERMISSIONS;
62     }
63     
64     /* (non-Javadoc)
65      * @see org.alfresco.repo.security.permissions.PermissionService#getPermissions(org.alfresco.service.cmr.repository.NodeRef)
66      */

67     public Set JavaDoc<AccessPermission> getPermissions(NodeRef nodeRef)
68     {
69         return null;
70     }
71
72     /* (non-Javadoc)
73      * @see org.alfresco.repo.security.permissions.PermissionService#getAllPermissions(org.alfresco.service.cmr.repository.NodeRef)
74      */

75     public Set JavaDoc<AccessPermission> getAllSetPermissions(NodeRef nodeRef)
76     {
77         return null;
78     }
79
80     /* (non-Javadoc)
81      * @see org.alfresco.repo.security.permissions.PermissionService#getSettablePermissions(org.alfresco.service.cmr.repository.NodeRef)
82      */

83     public Set JavaDoc<String JavaDoc> getSettablePermissions(NodeRef nodeRef)
84     {
85         return getSettablePermissions((QName)null);
86     }
87
88     /* (non-Javadoc)
89      * @see org.alfresco.repo.security.permissions.PermissionService#getSettablePermissions(org.alfresco.service.namespace.QName)
90      */

91     public Set JavaDoc<String JavaDoc> getSettablePermissions(QName type)
92     {
93         HashSet JavaDoc<String JavaDoc> permissions = new HashSet JavaDoc<String JavaDoc>();
94         permissions.add(ALL_PERMISSIONS);
95         return permissions;
96     }
97
98     /* (non-Javadoc)
99      * @see org.alfresco.repo.security.permissions.PermissionService#hasPermission(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.repo.security.permissions.PermissionReference)
100      */

101     public AccessStatus hasPermission(NodeRef nodeRef, String JavaDoc perm)
102     {
103         return AccessStatus.ALLOWED;
104     }
105
106     /* (non-Javadoc)
107      * @see org.alfresco.repo.security.permissions.PermissionService#deletePermissions(org.alfresco.service.cmr.repository.NodeRef)
108      */

109     public void deletePermissions(NodeRef nodeRef)
110     {
111     }
112
113     /* (non-Javadoc)
114      * @see org.alfresco.repo.security.permissions.PermissionService#deletePermission(org.alfresco.service.cmr.repository.NodeRef, java.lang.String, org.alfresco.repo.security.permissions.PermissionReference, boolean)
115      */

116     public void deletePermission(NodeRef nodeRef, String JavaDoc authority, String JavaDoc perm, boolean allow)
117     {
118     }
119
120     /* (non-Javadoc)
121      * @see org.alfresco.repo.security.permissions.PermissionService#setPermission(org.alfresco.service.cmr.repository.NodeRef, java.lang.String, org.alfresco.repo.security.permissions.PermissionReference, boolean)
122      */

123     public void setPermission(NodeRef nodeRef, String JavaDoc authority, String JavaDoc perm, boolean allow)
124     {
125     }
126
127     /* (non-Javadoc)
128      * @see org.alfresco.repo.security.permissions.PermissionService#setInheritParentPermissions(org.alfresco.service.cmr.repository.NodeRef, boolean)
129      */

130     public void setInheritParentPermissions(NodeRef nodeRef, boolean inheritParentPermissions)
131     {
132     }
133     
134     /* (non-Javadoc)
135     * @see org.alfresco.service.cmr.security.PermissionService#getInheritParentPermissions(org.alfresco.service.cmr.repository.NodeRef)
136     */

137    public boolean getInheritParentPermissions(NodeRef nodeRef)
138    {
139       // TODO Auto-generated method stub
140
return true;
141    }
142
143    public void clearPermission(NodeRef nodeRef, String JavaDoc authority)
144     {
145         
146     }
147
148     // SPI
149

150     public void deletePermission(PermissionEntry permissionEntry)
151     {
152         
153     }
154
155     public void deletePermissions(NodePermissionEntry nodePermissionEntry)
156     {
157         
158     }
159
160     public void deletePermissions(String JavaDoc recipient)
161     {
162         
163     }
164
165     public NodePermissionEntry explainPermission(NodeRef nodeRef, PermissionReference perm)
166     {
167        throw new UnsupportedOperationException JavaDoc();
168     }
169
170     public PermissionReference getAllPermissionReference()
171     {
172         throw new UnsupportedOperationException JavaDoc();
173     }
174
175     public String JavaDoc getPermission(PermissionReference permissionReference)
176     {
177         throw new UnsupportedOperationException JavaDoc();
178     }
179
180     public PermissionReference getPermissionReference(QName qname, String JavaDoc permissionName)
181     {
182         throw new UnsupportedOperationException JavaDoc();
183     }
184
185     public PermissionReference getPermissionReference(String JavaDoc permissionName)
186     {
187         throw new UnsupportedOperationException JavaDoc();
188     }
189
190     public NodePermissionEntry getSetPermissions(NodeRef nodeRef)
191     {
192         throw new UnsupportedOperationException JavaDoc();
193     }
194
195     public Set JavaDoc<PermissionReference> getSettablePermissionReferences(NodeRef nodeRef)
196     {
197         throw new UnsupportedOperationException JavaDoc();
198     }
199
200     public Set JavaDoc<PermissionReference> getSettablePermissionReferences(QName type)
201     {
202         throw new UnsupportedOperationException JavaDoc();
203     }
204
205     public AccessStatus hasPermission(NodeRef nodeRef, PermissionReference perm)
206     {
207         throw new UnsupportedOperationException JavaDoc();
208     }
209
210     public void setPermission(NodePermissionEntry nodePermissionEntry)
211     {
212         throw new UnsupportedOperationException JavaDoc();
213     }
214
215     public void setPermission(PermissionEntry permissionEntry)
216     {
217         throw new UnsupportedOperationException JavaDoc();
218     }
219 }
220
Popular Tags