1 package org.enhydra.shark.security; 2 3 4 import java.util.*; 5 6 import org.enhydra.shark.api.RootException; 7 import org.enhydra.shark.api.SharkTransaction; 8 import org.enhydra.shark.api.internal.security.SecurityException; 9 import org.enhydra.shark.api.internal.security.SecurityManager; 10 import org.enhydra.shark.api.internal.working.CallbackUtilities; 11 12 17 public class StandardSecurityManager implements SecurityManager { 18 19 private static final String SECURITY_MODE_NO_SECURITY="NO_SECURITY"; 20 private static final String SECURITY_MODE_NORMAL_SECURITY="NORMAL_SECURITY"; 21 private static final String SECURITY_MODE_ADMIN_SECURITY="ADMIN_SECURITY"; 22 23 private static final int SECURITY_MODE_NUM_NO_SECURITY=0; 24 private static final int SECURITY_MODE_NUM_NORMAL_SECURITY=1; 25 private static final int SECURITY_MODE_NUM_ADMIN_SECURITY=2; 26 27 private final static String ADMIN_USER_PREFIX="StandardSecurityManager.AdminUser"; 28 29 private CallbackUtilities cus; 30 31 private int SECURITY_MODE=SECURITY_MODE_NUM_NORMAL_SECURITY; 32 33 private Set adminUsers=new HashSet(); 34 35 public void configure (CallbackUtilities cus) throws RootException { 36 this.cus=cus; 37 38 String sec_m=cus.getProperty("StandardSecurityManager.SECURITY_MODE","NORMAL_SECURITY"); 39 String sm=null; 40 if (sec_m.equals(SECURITY_MODE_NO_SECURITY)) { 41 SECURITY_MODE=SECURITY_MODE_NUM_NO_SECURITY; 42 sm=SECURITY_MODE_NO_SECURITY; 43 } else if (sec_m.equals(SECURITY_MODE_ADMIN_SECURITY)) { 44 SECURITY_MODE=SECURITY_MODE_NUM_ADMIN_SECURITY; 45 sm=SECURITY_MODE_ADMIN_SECURITY; 46 } else { 47 SECURITY_MODE=SECURITY_MODE_NUM_NORMAL_SECURITY; 48 sm=SECURITY_MODE_NORMAL_SECURITY; 49 } 50 51 cus.info("StandardSecurityManager -> Security mode set to "+sm); 52 53 Properties props= cus.getProperties(); 54 Iterator it=props.entrySet().iterator(); 55 while (it.hasNext()) { 56 try { 57 Map.Entry me=(Map.Entry)it.next(); 58 String entry=me.getKey().toString(); 59 if (entry.startsWith(ADMIN_USER_PREFIX)) { 60 String adminUser=me.getValue().toString(); 61 adminUsers.add(adminUser); 62 } 63 } catch (Throwable ex) { 64 cus.error("StandardSecurityManager -> Error when retrieving list of admins from properties!!!"); 65 } 66 } 67 System.out.println("Admin users are:"+adminUsers); 68 } 69 70 public List getAssignments ( 71 SharkTransaction t, 72 String engineName, 73 String procId, 74 String actId, 75 List userIds) throws RootException { 76 77 return userIds; 78 } 79 80 public void check_processmgr_how_many_process (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 82 83 } 84 85 public void check_processmgr_get_iterator_process (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 86 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 87 if (!adminUsers.contains(userId)) { 88 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over process manager's processes!"); 89 } 90 } 91 } 92 93 public void check_processmgr_get_sequence_process (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 94 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 95 if (!adminUsers.contains(userId)) { 96 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for the list of the process manager's processes!"); 97 } 98 } 99 } 100 101 public void check_processmgr_is_member_of_process (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 102 } 103 104 public void check_processmgr_process_mgr_state (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 105 106 } 107 108 public void check_processmgr_set_process_mgr_state (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 109 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 110 if (!adminUsers.contains(userId)) { 111 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process manager state!"); 112 } 113 } 114 } 115 116 public void check_processmgr_name (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 117 118 } 119 120 public void check_processmgr_description (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 121 122 } 123 124 public void check_processmgr_category (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 125 126 } 127 128 public void check_processmgr_version (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 129 130 } 131 132 public void check_processmgr_context_signature (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 133 134 } 135 136 public void check_processmgr_result_signature (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 137 138 } 139 140 public void check_processmgr_create_process (SharkTransaction t,String name,String userId,String pkgId,String version,String pDefId) throws SecurityException { 141 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 142 if (!adminUsers.contains(userId)) { 143 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to create processes!"); 144 } 145 } 146 } 147 148 149 151 public void check_process_workflow_state (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 153 154 } 155 156 public void check_process_while_open (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 157 158 } 159 160 public void check_process_why_not_running (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 161 162 } 163 164 public void check_process_how_closed (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 165 166 } 167 168 public void check_process_valid_states (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 169 170 } 171 172 public void check_process_state (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 173 174 } 175 176 public void check_process_change_state (SharkTransaction t,String procId,String userId,String procCreator,String curState,String new_state) throws SecurityException { 177 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 178 if (!adminUsers.contains(userId)) { 179 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process state!"); 180 } 181 } 182 } 183 184 public void check_process_name (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 185 186 } 187 188 public void check_process_set_name (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 189 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 190 if (!adminUsers.contains(userId)) { 191 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process name!"); 192 } 193 } 194 } 195 196 public void check_process_key (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 197 198 } 199 200 public void check_process_description (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 201 202 } 203 204 public void check_process_set_description (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 205 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 206 if (!adminUsers.contains(userId)) { 207 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process description!"); 208 } 209 } 210 } 211 212 public void check_process_process_context (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 213 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 214 if (!adminUsers.contains(userId)) { 215 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process context!"); 216 } 217 } 218 } 219 220 public void check_process_set_process_context (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 221 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 222 if (!adminUsers.contains(userId)) { 223 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process context!"); 224 } 225 } 226 } 227 228 public void check_process_priority (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 229 230 } 231 232 public void check_process_set_priority (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 233 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 234 if (!adminUsers.contains(userId)) { 235 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process priority!"); 236 } 237 } 238 } 239 240 public void check_process_resume (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 241 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 242 if (!adminUsers.contains(userId)) { 243 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to resume process!"); 244 } 245 } 246 } 247 248 public void check_process_suspend (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 249 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 250 if (!adminUsers.contains(userId)) { 251 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to suspend process!"); 252 } 253 } 254 } 255 256 public void check_process_terminate (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 257 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 258 if (!adminUsers.contains(userId)) { 259 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to terminate process!"); 260 } 261 } 262 } 263 264 public void check_process_abort (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 265 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 266 if (!adminUsers.contains(userId)) { 267 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to abort process!"); 268 } 269 } 270 } 271 272 public void check_process_how_many_history (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 273 274 } 275 276 public void check_process_get_iterator_history (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 277 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 278 if (!adminUsers.contains(userId)) { 279 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over process history!"); 280 } 281 } 282 } 283 284 public void check_process_get_sequence_history (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 285 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 286 if (!adminUsers.contains(userId)) { 287 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process history!"); 288 } 289 } 290 } 291 292 public void check_process_is_member_of_history (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 293 294 } 295 296 public void check_process_last_state_time (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 297 298 } 299 300 public void check_process_requester (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 302 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 303 if (!adminUsers.contains(userId)) { 304 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process requester!"); 305 } 306 } 307 } 308 309 public void check_process_set_requester (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 310 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 311 if (!adminUsers.contains(userId)) { 312 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change process requester!"); 313 } 314 } 315 } 316 317 public void check_process_how_many_step (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 318 319 } 320 321 public void check_process_get_iterator_step (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 322 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 323 if (!adminUsers.contains(userId)) { 324 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over process activities!"); 325 } 326 } 327 } 328 329 public void check_process_get_sequence_step (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 330 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 331 if (!adminUsers.contains(userId)) { 332 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process steps!"); 333 } 334 } 335 } 336 337 public void check_process_is_member_of_step (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 338 339 } 340 341 public void check_process_manager (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 342 343 } 344 345 public void check_process_result (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 346 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 347 if (!adminUsers.contains(userId)) { 348 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process result!"); 349 } 350 } 351 } 352 353 public void check_process_start (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 354 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 355 if (!adminUsers.contains(userId)) { 356 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to start the process!"); 357 } 358 } 359 } 360 361 public void check_process_get_activities_in_state (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 362 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 363 if (!adminUsers.contains(userId)) { 364 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for process activities that are in certain state!"); 365 } 366 } 367 } 368 369 370 372 public void check_activity_workflow_state (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 374 375 } 376 377 public void check_activity_while_open (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 378 379 } 380 381 public void check_activity_why_not_running (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 382 383 } 384 385 public void check_activity_how_closed (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 386 387 } 388 389 public void check_activity_valid_states (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 390 391 } 392 393 public void check_activity_state (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 394 395 } 396 397 public void check_activity_change_state (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners,String curState,String new_state) throws SecurityException { 398 if (SECURITY_MODE>=SECURITY_MODE_NUM_NORMAL_SECURITY) { 399 if (new_state.equals("closed.aborted")) { 400 check_activity_abort(t,procId,actId,userId,procCreator,ownerId,possibleOwners); 401 } else if (new_state.equals("closed.completed")) { 402 check_activity_complete(t,procId,actId,userId,procCreator,ownerId,possibleOwners); 403 } else if (new_state.equals("closed.terminated")) { 404 check_activity_terminate(t,procId,actId,userId,procCreator,ownerId,possibleOwners); 405 } else if (new_state.equals("open.not_running.not_started")) { 406 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 407 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: Current activity state is "+curState+" - user "+userId+" can't change it to state "+new_state+". Only the owner or admin users are allowed to do it!"); 408 } 409 } else if (new_state.equals("open.not_running.suspended")) { 410 check_activity_suspend(t,procId,actId,userId,procCreator,ownerId,possibleOwners); 411 } else { if (curState.equals("open.not_running.not_started")) { 413 if (!possibleOwners.contains(userId) && !adminUsers.contains(userId)) { 414 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: Current activity state is "+curState+" - user "+userId+" can't change it to state "+new_state+". Only the owner or admin users are allowed to do it!"); 415 } 416 } 417 } 418 } 419 } 420 421 public void check_activity_name (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 422 423 } 424 425 public void check_activity_set_name (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 426 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 427 if (!adminUsers.contains(userId)) { 428 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change activity name!"); 429 } 430 } 431 } 432 433 public void check_activity_key (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 434 435 } 436 437 public void check_activity_description (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 438 439 } 440 441 public void check_activity_set_description (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 442 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 443 if (!adminUsers.contains(userId)) { 444 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change activity description!"); 445 } 446 } 447 } 448 449 public void check_activity_process_context (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 450 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 451 if (!adminUsers.contains(userId)) { 452 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for activity context!"); 453 } 454 } 455 } 456 457 public void check_activity_set_process_context (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 458 if (SECURITY_MODE>=SECURITY_MODE_NUM_NORMAL_SECURITY) { 459 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 460 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: Only the owner or admin users are allowed to set context of an activity!"); 461 } 462 } 463 } 464 465 public void check_activity_priority (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 466 467 } 468 469 public void check_activity_set_priority (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 470 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 471 if (!adminUsers.contains(userId)) { 472 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to change activity priority!"); 473 } 474 } 475 } 476 477 public void check_activity_resume (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 478 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 479 if (!adminUsers.contains(userId)) { 480 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to resume an activity!"); 481 } 482 } 483 } 484 485 public void check_activity_suspend (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 486 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 487 if (!adminUsers.contains(userId)) { 488 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to suspend an activity!"); 489 } 490 } 491 } 492 493 public void check_activity_terminate (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 494 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 495 if (!adminUsers.contains(userId)) { 496 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to terminate an activity!"); 497 } 498 } 499 } 500 501 public void check_activity_abort (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 502 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 503 if (!adminUsers.contains(userId)) { 504 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to abort an activity!"); 505 } 506 } 507 } 508 509 public void check_activity_how_many_history (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 510 511 } 512 513 public void check_activity_get_iterator_history (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 514 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 515 if (!adminUsers.contains(userId)) { 516 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over activity's history!"); 517 } 518 } 519 } 520 521 public void check_activity_get_sequence_history (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 522 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 523 if (!adminUsers.contains(userId)) { 524 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for a list of activity's history!"); 525 } 526 } 527 } 528 529 public void check_activity_is_member_of_history (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 530 531 } 532 533 public void check_activity_last_state_time (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 534 535 } 536 537 public void check_activity_how_many_performer(SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 539 540 } 541 542 public void check_activity_get_iterator_performer(SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 543 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 544 if (!adminUsers.contains(userId)) { 545 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over activity's performers!"); 546 } 547 } 548 } 549 550 public void check_activity_get_sequence_performer(SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 551 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 552 if (!adminUsers.contains(userId)) { 553 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for a list of performers!"); 554 } 555 } 556 } 557 558 public void check_activity_is_member_of_performer(SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 559 560 } 561 562 public void check_activity_receive_event(SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 563 564 } 565 566 public void check_activity_how_many_assignment (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 568 569 } 570 571 public void check_activity_get_iterator_assignment (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 572 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 573 if (!adminUsers.contains(userId)) { 574 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over activity's assignments!"); 575 } 576 } 577 } 578 579 public void check_activity_get_sequence_assignment (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 580 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 581 if (!adminUsers.contains(userId)) { 582 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for a list of activity's assignments!"); 583 } 584 } 585 } 586 587 public void check_activity_is_member_of_assignment (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 588 589 } 590 591 public void check_activity_container (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 592 593 } 594 595 public void check_activity_result (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 596 if (SECURITY_MODE==SECURITY_MODE_NUM_NORMAL_SECURITY) { 597 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 598 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: The activity's result can be obtained only by the user that owns it, or by the admin users!"); 599 } 600 } 601 } 602 603 public void check_activity_set_result (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 604 if (SECURITY_MODE>=SECURITY_MODE_NUM_NORMAL_SECURITY) { 605 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 606 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: The activity's result can be set only by the user that owns it, or by the admin users"); 607 } 608 } 609 } 610 611 public void check_activity_complete (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 612 if (SECURITY_MODE>=SECURITY_MODE_NUM_NORMAL_SECURITY) { 613 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 614 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: The activity can be completed only by the user that accepted its assignment or by the admin users!"); 615 } 616 } 617 } 618 619 620 public void check_assignment_activity (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 622 623 } 624 625 public void check_assignment_assignee (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 626 627 } 628 629 public void check_assignment_set_assignee (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 630 if (SECURITY_MODE==SECURITY_MODE_NUM_NORMAL_SECURITY) { 631 if (ownerId!=null && !userId.equals(ownerId)) { 632 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: If assignment is accepted, it can be reassigned only by the user that accepted it, or by the admin users"); 633 } 634 } 635 if (SECURITY_MODE>SECURITY_MODE_NUM_NORMAL_SECURITY) { 636 if (!userId.equals(ownerId) && !adminUsers.contains(userId)) { 637 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: Only the owner or admin users are allowed to change assignment's status!"); 638 } 639 } 640 641 } 642 643 public void check_assignment_set_accepted_status (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 644 if (SECURITY_MODE>=SECURITY_MODE_NUM_NORMAL_SECURITY) { 645 if (!userId.equals(username) && !adminUsers.contains(userId)) { 646 throw new SecurityException ("StandardSecurityManager -> NORMAL SECURITY RESTRICTION: Only the owner or admin users are allowed to change assignment's status!"); 647 } 648 } 649 } 650 651 public void check_assignment_get_accepted_status (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 652 653 } 654 655 656 public void check_resource_how_many_work_item (SharkTransaction t,String resourceId,String userId) throws SecurityException { 658 659 } 660 661 public void check_resource_get_iterator_work_item (SharkTransaction t,String resourceId,String userId) throws SecurityException { 662 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 663 if (!adminUsers.contains(userId)) { 664 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over resource's assignments!"); 665 } 666 } 667 } 668 669 public void check_resource_get_sequence_work_item (SharkTransaction t,String resourceId,String userId) throws SecurityException { 670 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 671 if (!adminUsers.contains(userId)) { 672 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for the list of resource's assignments!"); 673 } 674 } 675 } 676 677 public void check_resource_is_member_of_work_items (SharkTransaction t,String resourceId,String userId) throws SecurityException { 678 679 } 680 681 public void check_resource_resource_key (SharkTransaction t,String resourceId,String userId) throws SecurityException { 682 683 } 684 685 public void check_resource_resource_name (SharkTransaction t,String resourceId,String userId) throws SecurityException { 686 687 } 688 689 public void check_resource_release (SharkTransaction t,String resourceId,String userId) throws SecurityException { 690 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 691 if (!adminUsers.contains(userId)) { 692 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to release resource's assignment!"); 693 } 694 } 695 } 696 697 public void check_requester_how_many_performer (SharkTransaction t,String requesterResourceUsername,String userId) throws SecurityException { 699 700 } 701 702 public void check_requester_get_iterator_performer (SharkTransaction t,String requesterResourceUsername,String userId) throws SecurityException { 703 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 704 if (!adminUsers.contains(userId)) { 705 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to ask for iterator over requester's performers!"); 706 } 707 } 708 } 709 710 public void check_requester_get_sequence_performer (SharkTransaction t,String requesterResourceUsername,String userId) throws SecurityException { 711 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 712 if (!adminUsers.contains(userId)) { 713 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to get performer list!"); 714 } 715 } 716 } 717 718 public void check_requester_is_member_of_performer (SharkTransaction t,String requesterResourceUsername,String userId) throws SecurityException { 719 720 } 721 722 public void check_requester_receive_event (SharkTransaction t,String requesterResourceUsername,String userId) throws SecurityException { 723 724 } 725 726 public void check_sharkconnection_connect (SharkTransaction t,String userId) throws SecurityException { 728 729 } 730 731 public void check_sharkconnection_getResourceObject (SharkTransaction t,String userId) throws SecurityException { 732 733 } 734 735 public void check_sharkconnection_createProcess (SharkTransaction t,String pmgrname,String userId,String pkgId,String version,String pDefId) throws SecurityException { 736 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 737 if (!adminUsers.contains(userId)) { 738 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to create process!"); 739 } 740 } 741 } 742 743 744 public void check_executionadministration_connect (SharkTransaction t,String userId) throws SecurityException { 746 if (SECURITY_MODE==SECURITY_MODE_NUM_ADMIN_SECURITY) { 747 if (!adminUsers.contains(userId)) { 748 throw new SecurityException ("StandardSecurityManager -> ADMIN SECURITY RESTRICTION: Only admin users are allowed to use ExecutionAdministration interface !"); 749 } 750 } 751 } 752 753 public void check_executionadministration_get_iterator_processmgr (SharkTransaction t,String userId) throws SecurityException { 754 } 755 756 public void check_executionadministration_get_sequence_processmgr (SharkTransaction t,String userId) throws SecurityException { 757 } 758 759 public void check_executionadministration_getLoggedUsers (SharkTransaction t,String userId) throws SecurityException { 760 } 761 762 public void check_executionadministration_get_iterator_resource (SharkTransaction t,String userId) throws SecurityException { 763 } 764 765 public void check_executionadministration_get_sequence_resource (SharkTransaction t,String userId) throws SecurityException { 766 } 767 768 public void check_executionadministration_startActivity (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 769 } 770 771 public void check_executionadministration_getProcessMgr (SharkTransaction t,String userId,String name) throws SecurityException { 772 } 773 774 public void check_executionadministration_getResource (SharkTransaction t,String username,String userId) throws SecurityException { 775 } 776 777 public void check_executionadministration_getProcess (SharkTransaction t,String procId,String userId,String procCreator) throws SecurityException { 778 } 779 780 public void check_executionadministration_getActivity (SharkTransaction t,String procId,String actId,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 781 } 782 783 public void check_executionadministration_getAssignment (SharkTransaction t,String procId,String actId,String username,String userId,String procCreator,String ownerId,List possibleOwners) throws SecurityException { 784 } 785 786 public void check_executionadministration_getAssignment (SharkTransaction t,String procId,String assId,String userId,String procCreator) throws SecurityException { 787 } 788 789 public void check_executionadministration_reevaluateAssignments (SharkTransaction t,String userId) throws SecurityException { 790 } 791 792 public void check_executionadministration_deleteClosedProcesses (SharkTransaction t,String userId) throws SecurityException { 793 } 794 795 public void check_deadlines (SharkTransaction t,String userId) throws SecurityException { 797 } 798 799 } 800 | Popular Tags |