Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WorkflowNoteAttributeImpl |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2005-2011 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php | |
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 | package org.kuali.rice.kew.notes; | |
17 | ||
18 | import org.kuali.rice.kew.api.document.Document; | |
19 | import org.kuali.rice.krad.UserSession; | |
20 | ||
21 | ||
22 | /** | |
23 | * The default implementation of a CustomNoteAttribute in core workflow. This can be overriden | |
24 | * in the institution plugin extension. | |
25 | */ | |
26 | 0 | public class WorkflowNoteAttributeImpl implements CustomNoteAttribute { |
27 | ||
28 | private Document routeHeaderVO; | |
29 | ||
30 | private UserSession userSession; | |
31 | ||
32 | @Override | |
33 | public boolean isAuthorizedToAddNotes() throws Exception { | |
34 | 0 | return true; |
35 | } | |
36 | ||
37 | /** | |
38 | * By default the individual who authored the note is the only one allowed to edit it. | |
39 | */ | |
40 | @Override | |
41 | public boolean isAuthorizedToEditNote(Note note) throws Exception { | |
42 | 0 | return note.getNoteAuthorWorkflowId().equalsIgnoreCase(userSession.getPrincipalId()); |
43 | } | |
44 | ||
45 | @Override | |
46 | public Document getRouteHeaderVO() { | |
47 | 0 | return routeHeaderVO; |
48 | } | |
49 | ||
50 | @Override | |
51 | public void setRouteHeaderVO(Document routeHeaderVO) { | |
52 | 0 | this.routeHeaderVO = routeHeaderVO; |
53 | 0 | } |
54 | ||
55 | @Override | |
56 | public UserSession getUserSession() { | |
57 | 0 | return userSession; |
58 | } | |
59 | ||
60 | @Override | |
61 | public void setUserSession(UserSession userSession) { | |
62 | 0 | this.userSession = userSession; |
63 | 0 | } |
64 | ||
65 | @Override | |
66 | public boolean isAuthorizedToRetrieveAttachments() throws Exception { | |
67 | 0 | return true; |
68 | } | |
69 | } |