@@ -50,6 +50,9 @@ List<WorkFlow> getWorkFlows(ProcessesFilter filter,
5050 int countWorkFlows (ProcessesFilter filter ,
5151 long userIdentityId ) throws IllegalAccessException ;
5252
53+ WorkFlow getWorkFlow (long id ,
54+ long userIdentityId ) throws IllegalAccessException ;
55+
5356 WorkFlow getWorkFlow (long id ) throws IllegalAccessException ;
5457
5558 WorkFlow createWorkFlow (WorkFlow workFlow , long userId ) throws IllegalAccessException ;
@@ -69,6 +72,8 @@ WorkFlow updateWorkFlow(WorkFlow workFlow,
6972 */
7073 List <Work > getWorks (long userIdentityId , WorkFilter workFilter , int offset , int limit ) throws Exception ;
7174
75+ WorkFlow getWorkFlowByProjectId (long projectId , long userId ) throws IllegalAccessException ;
76+
7277 WorkFlow getWorkFlowByProjectId (long projectId );
7378
7479 /**
@@ -88,32 +93,38 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
8893 * Delete a workflow by its given Id.
8994 *
9095 * @param workflowId : workflow id
96+ * @param userId user id
9197 */
92- void deleteWorkflowById (Long workflowId ) ;
98+ void deleteWorkflowById (Long workflowId , long userId ) throws IllegalAccessException , ObjectNotFoundException ;
9399
94100 /**
95101 * @param projectId: Tasks project id
96102 * @param isCompleted: filter by completed and uncompleted tasks
103+ * @param userId user id
97104 * @return Filtered tasks count
98105 * @throws Exception
99106 */
100- int countWorksByWorkflow (Long projectId , Boolean isCompleted ) throws Exception ;
107+ int countWorksByWorkflow (Long projectId , long userId , Boolean isCompleted ) throws Exception ;
101108
102109 /**
103110 * Delete a work by its given id.
104111 *
105112 * @param workId: Work id
113+ * @param userId user identity ID
106114 */
107- void deleteWorkById (Long workId ) ;
115+ void deleteWorkById (Long workId , long userId ) throws ObjectNotFoundException , IllegalAccessException ;
108116
109117 /**
110118 * update the completed property of the task of a work to completed or uncompleted
111119 *
112120 * @param workId work id
121+ * @param userId user identity ID
113122 * @param completed work completed property, can be true or false
123+ * @throws ObjectNotFoundException
124+ * @throws IllegalAccessException
114125 * @return {@link Work}
115126 */
116- Work updateWorkCompleted (Long workId , boolean completed );
127+ Work updateWorkCompleted (Long workId , long userId , boolean completed ) throws ObjectNotFoundException , IllegalAccessException ;
117128
118129 /**
119130 * Creates a work draft
@@ -122,8 +133,9 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
122133 * @param userId user identity
123134 * @return {@link Work}
124135 * @throws IllegalArgumentException
136+
125137 */
126- Work createWorkDraft (Work work , long userId ) throws IllegalArgumentException ;
138+ Work createWorkDraft (Work work , long userId ) throws IllegalArgumentException , IllegalAccessException ;
127139
128140 /**
129141 * Updates a work draft
@@ -134,7 +146,7 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
134146 * @throws IllegalArgumentException
135147 * @throws ObjectNotFoundException
136148 */
137- Work updateWorkDraft (Work work , long userId ) throws IllegalArgumentException , ObjectNotFoundException ;
149+ Work updateWorkDraft (Work work , long userId ) throws IllegalArgumentException , ObjectNotFoundException , IllegalAccessException ;
138150
139151 /**
140152 * Retrieves a list of accessible WorkDraft, for a selected user
@@ -150,9 +162,10 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
150162 /**
151163 * Deletes a work draft by its given id
152164 *
153- * @param id Work draft id
165+ * @param userId user identity Id
166+ * @param draftId Work draft id
154167 */
155- void deleteWorkDraftById (Long id ) ;
168+ void deleteWorkDraftById (Long draftId , long userId ) throws IllegalAccessException , ObjectNotFoundException ;
156169
157170 /**
158171 * Retrieves the list of available statuses in all workflows
@@ -164,21 +177,37 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
164177 /**
165178 * Retrieves a Work by its given id
166179 *
167- * @param userIdentityId user identity id
180+ * @param userId user identity id
168181 * @param workId Work id
169182 * @return {@link Work}
170183 */
171- Work getWorkById (long userIdentityId , Long workId );
184+ Work getWorkById (long userId , Long workId ) throws IllegalAccessException ;
172185
173186 /**
174187 * Retrieves an illustration image by its given id
175188 *
176189 * @param illustrationId illustration file id
190+ * @param userId user id
177191 * @return {@link IllustrativeAttachment}
178192 * @throws FileStorageException
179193 * @throws ObjectNotFoundException
180194 */
181- IllustrativeAttachment getIllustrationImageById (Long illustrationId ) throws FileStorageException ,
195+ IllustrativeAttachment getIllustrationImageById (Long illustrationId ,
196+ long userId ) throws FileStorageException ,
182197 ObjectNotFoundException ,
183198 IOException ;
199+
200+ boolean canAccess (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
201+
202+ boolean canAdd (org .exoplatform .services .security .Identity identity );
203+
204+ boolean canEdit (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
205+
206+ boolean canDelete (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
207+
208+ boolean canAddRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
209+
210+ boolean canEditRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
211+
212+ boolean canDeleteRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
184213}
0 commit comments