aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-15 03:14:48 +0000
committerTeravus Ovares2008-05-15 03:14:48 +0000
commitbc177b1c37bff12030d978f45e94227e141e6fed (patch)
tree4004f19ade62a07101402453abc747daa117e2d7 /OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
parent* Got rid of an old crufty sleep that was being called. Thanks for your sup... (diff)
downloadopensim-SC_OLD-bc177b1c37bff12030d978f45e94227e141e6fed.zip
opensim-SC_OLD-bc177b1c37bff12030d978f45e94227e141e6fed.tar.gz
opensim-SC_OLD-bc177b1c37bff12030d978f45e94227e141e6fed.tar.bz2
opensim-SC_OLD-bc177b1c37bff12030d978f45e94227e141e6fed.tar.xz
* Committing Patch mantis 0001275: [PATCH] Add more perms-fu. From Melanie. Thanks Melanie!
* Adds hooks in the permission module for CanReadScript, CanEditScript, CanCopyInventory, CanDeleteInventory, CanEditNotecard, CanViewNotecard, CanViewScript.. and a few more. The functionality in the default module returns true.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs250
1 files changed, 241 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 53c8fc3..fcc6c75 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -437,7 +437,7 @@ namespace OpenSim.Region.Environment.Scenes
437 #endregion 437 #endregion
438 438
439 #region VIEW SCRIPT 439 #region VIEW SCRIPT
440 public delegate bool CanViewScript(LLUUID script, LLUUID user, Scene scene); 440 public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
441 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); 441 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>();
442 442
443 public void addCheckViewScript(CanViewScript delegateFunc) 443 public void addCheckViewScript(CanViewScript delegateFunc)
@@ -451,11 +451,37 @@ namespace OpenSim.Region.Environment.Scenes
451 CanViewScriptCheckFunctions.Remove(delegateFunc); 451 CanViewScriptCheckFunctions.Remove(delegateFunc);
452 } 452 }
453 453
454 public bool ExternalChecksCanViewScript(LLUUID script, LLUUID user) 454 public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user)
455 { 455 {
456 foreach (CanViewScript check in CanViewScriptCheckFunctions) 456 foreach (CanViewScript check in CanViewScriptCheckFunctions)
457 { 457 {
458 if (check(script, user, m_scene) == false) 458 if (check(script, objectID, user, m_scene) == false)
459 {
460 return false;
461 }
462 }
463 return true;
464 }
465
466 public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
467 private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>();
468
469 public void addCheckViewNotecard(CanViewNotecard delegateFunc)
470 {
471 if (!CanViewNotecardCheckFunctions.Contains(delegateFunc))
472 CanViewNotecardCheckFunctions.Add(delegateFunc);
473 }
474 public void removeCheckViewNotecard(CanViewNotecard delegateFunc)
475 {
476 if (CanViewNotecardCheckFunctions.Contains(delegateFunc))
477 CanViewNotecardCheckFunctions.Remove(delegateFunc);
478 }
479
480 public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user)
481 {
482 foreach (CanViewNotecard check in CanViewNotecardCheckFunctions)
483 {
484 if (check(script, objectID, user, m_scene) == false)
459 { 485 {
460 return false; 486 return false;
461 } 487 }
@@ -466,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes
466 #endregion 492 #endregion
467 493
468 #region EDIT SCRIPT 494 #region EDIT SCRIPT
469 public delegate bool CanEditScript(LLUUID script, LLUUID user, Scene scene); 495 public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
470 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); 496 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>();
471 497
472 public void addCheckEditScript(CanEditScript delegateFunc) 498 public void addCheckEditScript(CanEditScript delegateFunc)
@@ -480,11 +506,37 @@ namespace OpenSim.Region.Environment.Scenes
480 CanEditScriptCheckFunctions.Remove(delegateFunc); 506 CanEditScriptCheckFunctions.Remove(delegateFunc);
481 } 507 }
482 508
483 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID user) 509 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user)
484 { 510 {
485 foreach (CanEditScript check in CanEditScriptCheckFunctions) 511 foreach (CanEditScript check in CanEditScriptCheckFunctions)
486 { 512 {
487 if (check(script, user, m_scene) == false) 513 if (check(script, objectID, user, m_scene) == false)
514 {
515 return false;
516 }
517 }
518 return true;
519 }
520
521 public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene);
522 private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>();
523
524 public void addCheckEditNotecard(CanEditNotecard delegateFunc)
525 {
526 if (!CanEditNotecardCheckFunctions.Contains(delegateFunc))
527 CanEditNotecardCheckFunctions.Add(delegateFunc);
528 }
529 public void removeCheckEditNotecard(CanEditNotecard delegateFunc)
530 {
531 if (CanEditNotecardCheckFunctions.Contains(delegateFunc))
532 CanEditNotecardCheckFunctions.Remove(delegateFunc);
533 }
534
535 public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user)
536 {
537 foreach (CanEditNotecard check in CanEditNotecardCheckFunctions)
538 {
539 if (check(script, objectID, user, m_scene) == false)
488 { 540 {
489 return false; 541 return false;
490 } 542 }
@@ -495,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
495 #endregion 547 #endregion
496 548
497 #region RUN SCRIPT 549 #region RUN SCRIPT
498 public delegate bool CanRunScript(LLUUID script, LLUUID user, Scene scene); 550 public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
499 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); 551 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>();
500 552
501 public void addCheckRunScript(CanRunScript delegateFunc) 553 public void addCheckRunScript(CanRunScript delegateFunc)
@@ -509,11 +561,11 @@ namespace OpenSim.Region.Environment.Scenes
509 CanRunScriptCheckFunctions.Remove(delegateFunc); 561 CanRunScriptCheckFunctions.Remove(delegateFunc);
510 } 562 }
511 563
512 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID user) 564 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user)
513 { 565 {
514 foreach (CanRunScript check in CanRunScriptCheckFunctions) 566 foreach (CanRunScript check in CanRunScriptCheckFunctions)
515 { 567 {
516 if (check(script, user, m_scene) == false) 568 if (check(script, objectID, user, m_scene) == false)
517 { 569 {
518 return false; 570 return false;
519 } 571 }
@@ -721,9 +773,189 @@ namespace OpenSim.Region.Environment.Scenes
721 } 773 }
722 #endregion 774 #endregion
723 775
776 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene);
777 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>();
778
779 public void addCheckCanBuyLand(CanBuyLand delegateFunc)
780 {
781 if (!CanBuyLandCheckFunctions.Contains(delegateFunc))
782 CanBuyLandCheckFunctions.Add(delegateFunc);
783 }
784 public void removeCheckCanBuyLand(CanBuyLand delegateFunc)
785 {
786 if (CanBuyLandCheckFunctions.Contains(delegateFunc))
787 CanBuyLandCheckFunctions.Remove(delegateFunc);
788 }
789
790 public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel)
791 {
792 foreach (CanBuyLand check in CanBuyLandCheckFunctions)
793 {
794 if (check(user, parcel, m_scene) == false)
795 {
796 return false;
797 }
798 }
799 return true;
800 }
801
802 public delegate bool CanLinkObject(LLUUID user, LLUUID objectID);
803 private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>();
804
805 public void addCheckCanLinkObject(CanLinkObject delegateFunc)
806 {
807 if (!CanLinkObjectCheckFunctions.Contains(delegateFunc))
808 CanLinkObjectCheckFunctions.Add(delegateFunc);
809 }
810 public void removeCheckCanLinkObject(CanLinkObject delegateFunc)
811 {
812 if (CanLinkObjectCheckFunctions.Contains(delegateFunc))
813 CanLinkObjectCheckFunctions.Remove(delegateFunc);
814 }
815
816 public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID)
817 {
818 foreach (CanLinkObject check in CanLinkObjectCheckFunctions)
819 {
820 if (check(user, objectID) == false)
821 {
822 return false;
823 }
824 }
825 return true;
826 }
827
828 public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID);
829 private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>();
830
831 public void addCheckCanDelinkObject(CanDelinkObject delegateFunc)
832 {
833 if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc))
834 CanDelinkObjectCheckFunctions.Add(delegateFunc);
835 }
836 public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc)
837 {
838 if (CanDelinkObjectCheckFunctions.Contains(delegateFunc))
839 CanDelinkObjectCheckFunctions.Remove(delegateFunc);
840 }
841
842 public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID)
843 {
844 foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions)
845 {
846 if (check(user, objectID) == false)
847 {
848 return false;
849 }
850 }
851 return true;
852 }
853
724 #endregion 854 #endregion
725 855
856 public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID);
857 private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>();
858
859 public void addCheckCanCreateInventory(CanCreateInventory delegateFunc)
860 {
861 if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc))
862 CanCreateInventoryCheckFunctions.Add(delegateFunc);
863 }
864 public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc)
865 {
866 if (CanCreateInventoryCheckFunctions.Contains(delegateFunc))
867 CanCreateInventoryCheckFunctions.Remove(delegateFunc);
868 }
869
870 public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
871 {
872 foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions)
873 {
874 if (check(invType, objectID, userID) == false)
875 {
876 return false;
877 }
878 }
879 return true;
880 }
881
882 public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID);
883 private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>();
726 884
885 public void addCheckCanCopyInventory(CanCopyInventory delegateFunc)
886 {
887 if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc))
888 CanCopyInventoryCheckFunctions.Add(delegateFunc);
889 }
890 public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc)
891 {
892 if (CanCopyInventoryCheckFunctions.Contains(delegateFunc))
893 CanCopyInventoryCheckFunctions.Remove(delegateFunc);
894 }
895
896 public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
897 {
898 foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions)
899 {
900 if (check(itemID, objectID, userID) == false)
901 {
902 return false;
903 }
904 }
905 return true;
906 }
907
908 public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID);
909 private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>();
910
911 public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
912 {
913 if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
914 CanDeleteInventoryCheckFunctions.Add(delegateFunc);
915 }
916 public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
917 {
918 if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
919 CanDeleteInventoryCheckFunctions.Remove(delegateFunc);
920 }
921
922 public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
923 {
924 foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions)
925 {
926 if (check(itemID, objectID, userID) == false)
927 {
928 return false;
929 }
930 }
931 return true;
932 }
933
934 public delegate bool CanTeleport(LLUUID userID);
935 private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>();
936
937 public void addCheckCanTeleport(CanTeleport delegateFunc)
938 {
939 if (!CanTeleportCheckFunctions.Contains(delegateFunc))
940 CanTeleportCheckFunctions.Add(delegateFunc);
941 }
942 public void removeCheckCanTeleport(CanTeleport delegateFunc)
943 {
944 if (CanTeleportCheckFunctions.Contains(delegateFunc))
945 CanTeleportCheckFunctions.Remove(delegateFunc);
946 }
947
948 public bool ExternalChecksCanTeleport(LLUUID userID)
949 {
950 foreach (CanTeleport check in CanTeleportCheckFunctions)
951 {
952 if (check(userID) == false)
953 {
954 return false;
955 }
956 }
957 return true;
958 }
727 } 959 }
728} 960}
729 961