OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Scene.Permissions.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Collections.Generic;
30 using System.Reflection;
31 using System.Text;
32 using log4net;
33 using OpenMetaverse;
34 using OpenSim.Framework;
35 using OpenSim.Region.Framework.Interfaces;
36 
37 namespace OpenSim.Region.Framework.Scenes
38 {
39  #region Delegates
40  public delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID);
41  public delegate void SetBypassPermissionsHandler(bool value);
42  public delegate bool BypassPermissionsHandler();
43  public delegate bool PropagatePermissionsHandler();
44  public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene);
45  public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene);
46  public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene);
47  public delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene);
48  public delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene);
49  public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
50  public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene);
51  public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
52  public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene);
53  public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene);
54  public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene);
55  public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene);
56  public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene);
57  public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene);
58  public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene);
59  public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene);
60  public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene);
61  public delegate bool RunScriptHandler(UUID script, UUID objectID, UUID user, Scene scene);
62  public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene);
63  public delegate bool StartScriptHandler(UUID script, UUID user, Scene scene);
64  public delegate bool StopScriptHandler(UUID script, UUID user, Scene scene);
65  public delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user, Scene scene);
66  public delegate bool TerraformLandHandler(UUID user, Vector3 position, Scene requestFromScene);
67  public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
68  public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
69  public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
70  public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
71  public delegate bool IsAdministratorHandler(UUID user);
72  public delegate bool IsEstateManagerHandler(UUID user);
73  public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
74  public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager);
75  public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
76  public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
77  public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
78  public delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene);
79  public delegate bool DeedObjectHandler(UUID user, UUID group, Scene scene);
80  public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene);
81  public delegate bool LinkObjectHandler(UUID user, UUID objectID);
82  public delegate bool DelinkObjectHandler(UUID user, UUID objectID);
83  public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID);
84  public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
85  public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
86  public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID);
87  public delegate bool CreateUserInventoryHandler(int invType, UUID userID);
88  public delegate bool EditUserInventoryHandler(UUID itemID, UUID userID);
89  public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID);
90  public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID);
91  public delegate bool TransferUserInventoryHandler(UUID itemID, UUID userID, UUID recipientID);
92  public delegate bool TeleportHandler(UUID userID, Scene scene);
93  public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face);
94  public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face);
95  #endregion
96 
97  public class ScenePermissions
98  {
99 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
100 
101  private Scene m_scene;
102 
103  public ScenePermissions(Scene scene)
104  {
105  m_scene = scene;
106  }
107 
108  #region Events
138  public event IsGodHandler OnIsGod;
142 // public event EditParcelHandler OnEditParcel;
149  public event BuyLandHandler OnBuyLand;
164  #endregion
165 
166  #region Object Permission Checks
167 
168  public uint GenerateClientFlags(UUID userID, UUID objectID)
169  {
170  // libomv will moan about PrimFlags.ObjectYouOfficer being
171  // obsolete...
172 #pragma warning disable 0612
173  const PrimFlags DEFAULT_FLAGS =
174  PrimFlags.ObjectModify |
175  PrimFlags.ObjectCopy |
176  PrimFlags.ObjectMove |
177  PrimFlags.ObjectTransfer |
178  PrimFlags.ObjectYouOwner |
179  PrimFlags.ObjectAnyOwner |
180  PrimFlags.ObjectOwnerModify |
181  PrimFlags.ObjectYouOfficer;
182 #pragma warning restore 0612
183 
184  SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
185 
186  if (part == null)
187  return 0;
188 
189  uint perms = part.GetEffectiveObjectFlags() | (uint)DEFAULT_FLAGS;
190 
191  GenerateClientFlagsHandler handlerGenerateClientFlags = OnGenerateClientFlags;
192  if (handlerGenerateClientFlags != null)
193  {
194  Delegate[] list = handlerGenerateClientFlags.GetInvocationList();
195  foreach (GenerateClientFlagsHandler check in list)
196  {
197  perms &= check(userID, objectID);
198  }
199  }
200  return perms;
201  }
202 
203  public void SetBypassPermissions(bool value)
204  {
205  SetBypassPermissionsHandler handler = OnSetBypassPermissions;
206  if (handler != null)
207  handler(value);
208  }
209 
210  public bool BypassPermissions()
211  {
212  BypassPermissionsHandler handler = OnBypassPermissions;
213  if (handler != null)
214  {
215  Delegate[] list = handler.GetInvocationList();
216  foreach (BypassPermissionsHandler h in list)
217  {
218  if (h() == false)
219  return false;
220  }
221  }
222  return true;
223  }
224 
225  public bool PropagatePermissions()
226  {
227  PropagatePermissionsHandler handler = OnPropagatePermissions;
228  if (handler != null)
229  {
230  Delegate[] list = handler.GetInvocationList();
231  foreach (PropagatePermissionsHandler h in list)
232  {
233  if (h() == false)
234  return false;
235  }
236  }
237  return true;
238  }
239 
240  #region REZ OBJECT
241  public bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition)
242  {
243  RezObjectHandler handler = OnRezObject;
244  if (handler != null)
245  {
246  Delegate[] list = handler.GetInvocationList();
247  foreach (RezObjectHandler h in list)
248  {
249  if (h(objectCount, owner,objectPosition, m_scene) == false)
250  return false;
251  }
252  }
253  return true;
254  }
255 
256  #endregion
257 
258  #region DELETE OBJECT
259  public bool CanDeleteObject(UUID objectID, UUID deleter)
260  {
261  bool result = true;
262 
263  DeleteObjectHandler handler = OnDeleteObject;
264  if (handler != null)
265  {
266  Delegate[] list = handler.GetInvocationList();
267  foreach (DeleteObjectHandler h in list)
268  {
269  if (h(objectID, deleter, m_scene) == false)
270  {
271  result = false;
272  break;
273  }
274  }
275  }
276 
277  return result;
278  }
279 
280  public bool CanTransferObject(UUID objectID, UUID recipient)
281  {
282  bool result = true;
283 
284  TransferObjectHandler handler = OnTransferObject;
285  if (handler != null)
286  {
287  Delegate[] list = handler.GetInvocationList();
288  foreach (TransferObjectHandler h in list)
289  {
290  if (h(objectID, recipient, m_scene) == false)
291  {
292  result = false;
293  break;
294  }
295  }
296  }
297 
298  return result;
299  }
300 
301  #endregion
302 
303  #region TAKE OBJECT
304  public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID)
305  {
306  bool result = true;
307 
308  TakeObjectHandler handler = OnTakeObject;
309  if (handler != null)
310  {
311  Delegate[] list = handler.GetInvocationList();
312  foreach (TakeObjectHandler h in list)
313  {
314  if (h(objectID, AvatarTakingUUID, m_scene) == false)
315  {
316  result = false;
317  break;
318  }
319  }
320  }
321 
322 // m_log.DebugFormat(
323 // "[SCENE PERMISSIONS]: CanTakeObject() fired for object {0}, taker {1}, result {2}",
324 // objectID, AvatarTakingUUID, result);
325 
326  return result;
327  }
328 
329  #endregion
330 
331  #region TAKE COPY OBJECT
332  public bool CanTakeCopyObject(UUID objectID, UUID userID)
333  {
334  bool result = true;
335 
336  TakeCopyObjectHandler handler = OnTakeCopyObject;
337  if (handler != null)
338  {
339  Delegate[] list = handler.GetInvocationList();
340  foreach (TakeCopyObjectHandler h in list)
341  {
342  if (h(objectID, userID, m_scene) == false)
343  {
344  result = false;
345  break;
346  }
347  }
348  }
349 
350 // m_log.DebugFormat(
351 // "[SCENE PERMISSIONS]: CanTakeCopyObject() fired for object {0}, user {1}, result {2}",
352 // objectID, userID, result);
353 
354  return result;
355  }
356 
357  #endregion
358 
359  #region DUPLICATE OBJECT
360  public bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition)
361  {
362  DuplicateObjectHandler handler = OnDuplicateObject;
363  if (handler != null)
364  {
365  Delegate[] list = handler.GetInvocationList();
366  foreach (DuplicateObjectHandler h in list)
367  {
368  if (h(objectCount, objectID, owner, m_scene, objectPosition) == false)
369  return false;
370  }
371  }
372  return true;
373  }
374 
375  #endregion
376 
377  #region EDIT OBJECT
378  public bool CanEditObject(UUID objectID, UUID editorID)
379  {
380  EditObjectHandler handler = OnEditObject;
381  if (handler != null)
382  {
383  Delegate[] list = handler.GetInvocationList();
384  foreach (EditObjectHandler h in list)
385  {
386  if (h(objectID, editorID, m_scene) == false)
387  return false;
388  }
389  }
390  return true;
391  }
392 
393  public bool CanEditObjectInventory(UUID objectID, UUID editorID)
394  {
395  EditObjectInventoryHandler handler = OnEditObjectInventory;
396  if (handler != null)
397  {
398  Delegate[] list = handler.GetInvocationList();
399  foreach (EditObjectInventoryHandler h in list)
400  {
401  if (h(objectID, editorID, m_scene) == false)
402  return false;
403  }
404  }
405  return true;
406  }
407 
408  #endregion
409 
410  #region MOVE OBJECT
411  public bool CanMoveObject(UUID objectID, UUID moverID)
412  {
413  MoveObjectHandler handler = OnMoveObject;
414  if (handler != null)
415  {
416  Delegate[] list = handler.GetInvocationList();
417  foreach (MoveObjectHandler h in list)
418  {
419  if (h(objectID, moverID, m_scene) == false)
420  return false;
421  }
422  }
423  return true;
424  }
425 
426  #endregion
427 
428  #region OBJECT ENTRY
429  public bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint)
430  {
431  ObjectEntryHandler handler = OnObjectEntry;
432  if (handler != null)
433  {
434  Delegate[] list = handler.GetInvocationList();
435  foreach (ObjectEntryHandler h in list)
436  {
437  if (h(objectID, enteringRegion, newPoint, m_scene) == false)
438  return false;
439  }
440  }
441  return true;
442  }
443 
444  #endregion
445 
446  #region RETURN OBJECT
447  public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects)
448  {
449  bool result = true;
450 
451  ReturnObjectsHandler handler = OnReturnObjects;
452  if (handler != null)
453  {
454  Delegate[] list = handler.GetInvocationList();
455  foreach (ReturnObjectsHandler h in list)
456  {
457  if (h(land, user, objects, m_scene) == false)
458  {
459  result = false;
460  break;
461  }
462  }
463  }
464 
465 // m_log.DebugFormat(
466 // "[SCENE PERMISSIONS]: CanReturnObjects() fired for user {0} for {1} objects on {2}, result {3}",
467 // user, objects.Count, land.LandData.Name, result);
468 
469  return result;
470  }
471 
472  #endregion
473 
474  #region INSTANT MESSAGE
475  public bool CanInstantMessage(UUID user, UUID target)
476  {
477  InstantMessageHandler handler = OnInstantMessage;
478  if (handler != null)
479  {
480  Delegate[] list = handler.GetInvocationList();
481  foreach (InstantMessageHandler h in list)
482  {
483  if (h(user, target, m_scene) == false)
484  return false;
485  }
486  }
487  return true;
488  }
489 
490  #endregion
491 
492  #region INVENTORY TRANSFER
493  public bool CanInventoryTransfer(UUID user, UUID target)
494  {
495  InventoryTransferHandler handler = OnInventoryTransfer;
496  if (handler != null)
497  {
498  Delegate[] list = handler.GetInvocationList();
499  foreach (InventoryTransferHandler h in list)
500  {
501  if (h(user, target, m_scene) == false)
502  return false;
503  }
504  }
505  return true;
506  }
507 
508  #endregion
509 
510  #region VIEW SCRIPT
511  public bool CanViewScript(UUID script, UUID objectID, UUID user)
512  {
513  ViewScriptHandler handler = OnViewScript;
514  if (handler != null)
515  {
516  Delegate[] list = handler.GetInvocationList();
517  foreach (ViewScriptHandler h in list)
518  {
519  if (h(script, objectID, user, m_scene) == false)
520  return false;
521  }
522  }
523  return true;
524  }
525 
526  public bool CanViewNotecard(UUID script, UUID objectID, UUID user)
527  {
528  ViewNotecardHandler handler = OnViewNotecard;
529  if (handler != null)
530  {
531  Delegate[] list = handler.GetInvocationList();
532  foreach (ViewNotecardHandler h in list)
533  {
534  if (h(script, objectID, user, m_scene) == false)
535  return false;
536  }
537  }
538  return true;
539  }
540 
541  #endregion
542 
543  #region EDIT SCRIPT
544  public bool CanEditScript(UUID script, UUID objectID, UUID user)
545  {
546  EditScriptHandler handler = OnEditScript;
547  if (handler != null)
548  {
549  Delegate[] list = handler.GetInvocationList();
550  foreach (EditScriptHandler h in list)
551  {
552  if (h(script, objectID, user, m_scene) == false)
553  return false;
554  }
555  }
556  return true;
557  }
558 
559  public bool CanEditNotecard(UUID script, UUID objectID, UUID user)
560  {
561  EditNotecardHandler handler = OnEditNotecard;
562  if (handler != null)
563  {
564  Delegate[] list = handler.GetInvocationList();
565  foreach (EditNotecardHandler h in list)
566  {
567  if (h(script, objectID, user, m_scene) == false)
568  return false;
569  }
570  }
571  return true;
572  }
573 
574  #endregion
575 
576  #region RUN SCRIPT (When Script Placed in Object)
577  public bool CanRunScript(UUID script, UUID objectID, UUID user)
578  {
579  RunScriptHandler handler = OnRunScript;
580  if (handler != null)
581  {
582  Delegate[] list = handler.GetInvocationList();
583  foreach (RunScriptHandler h in list)
584  {
585  if (h(script, objectID, user, m_scene) == false)
586  return false;
587  }
588  }
589  return true;
590  }
591 
592  #endregion
593 
594  #region COMPILE SCRIPT (When Script needs to get (re)compiled)
595  public bool CanCompileScript(UUID ownerUUID, int scriptType)
596  {
597  CompileScriptHandler handler = OnCompileScript;
598  if (handler != null)
599  {
600  Delegate[] list = handler.GetInvocationList();
601  foreach (CompileScriptHandler h in list)
602  {
603  if (h(ownerUUID, scriptType, m_scene) == false)
604  return false;
605  }
606  }
607  return true;
608  }
609 
610  #endregion
611 
612  #region START SCRIPT (When Script run box is Checked after placed in object)
613  public bool CanStartScript(UUID script, UUID user)
614  {
615  StartScriptHandler handler = OnStartScript;
616  if (handler != null)
617  {
618  Delegate[] list = handler.GetInvocationList();
619  foreach (StartScriptHandler h in list)
620  {
621  if (h(script, user, m_scene) == false)
622  return false;
623  }
624  }
625  return true;
626  }
627 
628  #endregion
629 
630  #region STOP SCRIPT (When Script run box is unchecked after placed in object)
631  public bool CanStopScript(UUID script, UUID user)
632  {
633  StopScriptHandler handler = OnStopScript;
634  if (handler != null)
635  {
636  Delegate[] list = handler.GetInvocationList();
637  foreach (StopScriptHandler h in list)
638  {
639  if (h(script, user, m_scene) == false)
640  return false;
641  }
642  }
643  return true;
644  }
645 
646  #endregion
647 
648  #region RESET SCRIPT
649  public bool CanResetScript(UUID prim, UUID script, UUID user)
650  {
651  ResetScriptHandler handler = OnResetScript;
652  if (handler != null)
653  {
654  Delegate[] list = handler.GetInvocationList();
655  foreach (ResetScriptHandler h in list)
656  {
657  if (h(prim, script, user, m_scene) == false)
658  return false;
659  }
660  }
661  return true;
662  }
663 
664  #endregion
665 
666  #region TERRAFORM LAND
667  public bool CanTerraformLand(UUID user, Vector3 pos)
668  {
669  TerraformLandHandler handler = OnTerraformLand;
670  if (handler != null)
671  {
672  Delegate[] list = handler.GetInvocationList();
673  foreach (TerraformLandHandler h in list)
674  {
675  if (h(user, pos, m_scene) == false)
676  return false;
677  }
678  }
679  return true;
680  }
681 
682  #endregion
683 
684  #region RUN CONSOLE COMMAND
685  public bool CanRunConsoleCommand(UUID user)
686  {
687  RunConsoleCommandHandler handler = OnRunConsoleCommand;
688  if (handler != null)
689  {
690  Delegate[] list = handler.GetInvocationList();
691  foreach (RunConsoleCommandHandler h in list)
692  {
693  if (h(user, m_scene) == false)
694  return false;
695  }
696  }
697  return true;
698  }
699 
700  #endregion
701 
702  #region CAN ISSUE ESTATE COMMAND
703  public bool CanIssueEstateCommand(UUID user, bool ownerCommand)
704  {
705  IssueEstateCommandHandler handler = OnIssueEstateCommand;
706  if (handler != null)
707  {
708  Delegate[] list = handler.GetInvocationList();
709  foreach (IssueEstateCommandHandler h in list)
710  {
711  if (h(user, m_scene, ownerCommand) == false)
712  return false;
713  }
714  }
715  return true;
716  }
717  #endregion
718 
719  #region CAN BE GODLIKE
720  public bool IsGod(UUID user)
721  {
722  IsGodHandler handler = OnIsGod;
723  if (handler != null)
724  {
725  Delegate[] list = handler.GetInvocationList();
726  foreach (IsGodHandler h in list)
727  {
728  if (h(user, m_scene) == false)
729  return false;
730  }
731  }
732  return true;
733  }
734 
735  public bool IsGridGod(UUID user)
736  {
737  IsGridGodHandler handler = OnIsGridGod;
738  if (handler != null)
739  {
740  Delegate[] list = handler.GetInvocationList();
741  foreach (IsGridGodHandler h in list)
742  {
743  if (h(user, m_scene) == false)
744  return false;
745  }
746  }
747  return true;
748  }
749 
750  public bool IsAdministrator(UUID user)
751  {
752  IsAdministratorHandler handler = OnIsAdministrator;
753  if (handler != null)
754  {
755  Delegate[] list = handler.GetInvocationList();
756  foreach (IsAdministratorHandler h in list)
757  {
758  if (h(user) == false)
759  return false;
760  }
761  }
762  return true;
763  }
764  #endregion
765 
766  public bool IsEstateManager(UUID user)
767  {
768  IsEstateManagerHandler handler = OnIsEstateManager;
769  if (handler != null)
770  {
771  Delegate[] list = handler.GetInvocationList();
772  foreach (IsEstateManagerHandler h in list)
773  {
774  if (h(user) == false)
775  return false;
776  }
777  }
778  return true;
779  }
780 
781  #region EDIT PARCEL
782 
783  public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, bool allowManager)
784  {
785  EditParcelPropertiesHandler handler = OnEditParcelProperties;
786  if (handler != null)
787  {
788  Delegate[] list = handler.GetInvocationList();
789  foreach (EditParcelPropertiesHandler h in list)
790  {
791  if (h(user, parcel, p, m_scene, allowManager) == false)
792  return false;
793  }
794  }
795  return true;
796  }
797  #endregion
798 
799  #region SELL PARCEL
800  public bool CanSellParcel(UUID user, ILandObject parcel)
801  {
802  SellParcelHandler handler = OnSellParcel;
803  if (handler != null)
804  {
805  Delegate[] list = handler.GetInvocationList();
806  foreach (SellParcelHandler h in list)
807  {
808  if (h(user, parcel, m_scene) == false)
809  return false;
810  }
811  }
812  return true;
813  }
814  #endregion
815 
816  #region ABANDON PARCEL
817  public bool CanAbandonParcel(UUID user, ILandObject parcel)
818  {
819  AbandonParcelHandler handler = OnAbandonParcel;
820  if (handler != null)
821  {
822  Delegate[] list = handler.GetInvocationList();
823  foreach (AbandonParcelHandler h in list)
824  {
825  if (h(user, parcel, m_scene) == false)
826  return false;
827  }
828  }
829  return true;
830  }
831  #endregion
832 
833  public bool CanReclaimParcel(UUID user, ILandObject parcel)
834  {
835  ReclaimParcelHandler handler = OnReclaimParcel;
836  if (handler != null)
837  {
838  Delegate[] list = handler.GetInvocationList();
839  foreach (ReclaimParcelHandler h in list)
840  {
841  if (h(user, parcel, m_scene) == false)
842  return false;
843  }
844  }
845  return true;
846  }
847 
848  public bool CanDeedParcel(UUID user, ILandObject parcel)
849  {
850  DeedParcelHandler handler = OnDeedParcel;
851  if (handler != null)
852  {
853  Delegate[] list = handler.GetInvocationList();
854  foreach (DeedParcelHandler h in list)
855  {
856  if (h(user, parcel, m_scene) == false)
857  return false;
858  }
859  }
860  return true;
861  }
862 
863  public bool CanDeedObject(UUID user, UUID group)
864  {
865  DeedObjectHandler handler = OnDeedObject;
866  if (handler != null)
867  {
868  Delegate[] list = handler.GetInvocationList();
869  foreach (DeedObjectHandler h in list)
870  {
871  if (h(user, group, m_scene) == false)
872  return false;
873  }
874  }
875  return true;
876  }
877 
878  public bool CanBuyLand(UUID user, ILandObject parcel)
879  {
880  BuyLandHandler handler = OnBuyLand;
881  if (handler != null)
882  {
883  Delegate[] list = handler.GetInvocationList();
884  foreach (BuyLandHandler h in list)
885  {
886  if (h(user, parcel, m_scene) == false)
887  return false;
888  }
889  }
890  return true;
891  }
892 
893  public bool CanLinkObject(UUID user, UUID objectID)
894  {
895  LinkObjectHandler handler = OnLinkObject;
896  if (handler != null)
897  {
898  Delegate[] list = handler.GetInvocationList();
899  foreach (LinkObjectHandler h in list)
900  {
901  if (h(user, objectID) == false)
902  return false;
903  }
904  }
905  return true;
906  }
907 
908  public bool CanDelinkObject(UUID user, UUID objectID)
909  {
910  DelinkObjectHandler handler = OnDelinkObject;
911  if (handler != null)
912  {
913  Delegate[] list = handler.GetInvocationList();
914  foreach (DelinkObjectHandler h in list)
915  {
916  if (h(user, objectID) == false)
917  return false;
918  }
919  }
920  return true;
921  }
922 
923  #endregion
924 
932  public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID)
933  {
934  CreateObjectInventoryHandler handler = OnCreateObjectInventory;
935  if (handler != null)
936  {
937  Delegate[] list = handler.GetInvocationList();
938  foreach (CreateObjectInventoryHandler h in list)
939  {
940  if (h(invType, objectID, userID) == false)
941  return false;
942  }
943  }
944  return true;
945  }
946 
947  public bool CanCopyObjectInventory(UUID itemID, UUID objectID, UUID userID)
948  {
949  CopyObjectInventoryHandler handler = OnCopyObjectInventory;
950  if (handler != null)
951  {
952  Delegate[] list = handler.GetInvocationList();
953  foreach (CopyObjectInventoryHandler h in list)
954  {
955  if (h(itemID, objectID, userID) == false)
956  return false;
957  }
958  }
959  return true;
960  }
961 
962  public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)
963  {
964  DeleteObjectInventoryHandler handler = OnDeleteObjectInventory;
965  if (handler != null)
966  {
967  Delegate[] list = handler.GetInvocationList();
968  foreach (DeleteObjectInventoryHandler h in list)
969  {
970  if (h(itemID, objectID, userID) == false)
971  return false;
972  }
973  }
974  return true;
975  }
976 
977  public bool CanTransferObjectInventory(UUID itemID, UUID objectID, UUID userID)
978  {
979  TransferObjectInventoryHandler handler = OnTransferObjectInventory;
980  if (handler != null)
981  {
982  Delegate[] list = handler.GetInvocationList();
983  foreach (TransferObjectInventoryHandler h in list)
984  {
985  if (h(itemID, objectID, userID) == false)
986  return false;
987  }
988  }
989  return true;
990  }
991 
998  public bool CanCreateUserInventory(int invType, UUID userID)
999  {
1000  CreateUserInventoryHandler handler = OnCreateUserInventory;
1001  if (handler != null)
1002  {
1003  Delegate[] list = handler.GetInvocationList();
1004  foreach (CreateUserInventoryHandler h in list)
1005  {
1006  if (h(invType, userID) == false)
1007  return false;
1008  }
1009  }
1010  return true;
1011  }
1012 
1019  public bool CanEditUserInventory(UUID itemID, UUID userID)
1020  {
1021  EditUserInventoryHandler handler = OnEditUserInventory;
1022  if (handler != null)
1023  {
1024  Delegate[] list = handler.GetInvocationList();
1025  foreach (EditUserInventoryHandler h in list)
1026  {
1027  if (h(itemID, userID) == false)
1028  return false;
1029  }
1030  }
1031  return true;
1032  }
1033 
1040  public bool CanCopyUserInventory(UUID itemID, UUID userID)
1041  {
1042  CopyUserInventoryHandler handler = OnCopyUserInventory;
1043  if (handler != null)
1044  {
1045  Delegate[] list = handler.GetInvocationList();
1046  foreach (CopyUserInventoryHandler h in list)
1047  {
1048  if (h(itemID, userID) == false)
1049  return false;
1050  }
1051  }
1052  return true;
1053  }
1054 
1061  public bool CanDeleteUserInventory(UUID itemID, UUID userID)
1062  {
1063  DeleteUserInventoryHandler handler = OnDeleteUserInventory;
1064  if (handler != null)
1065  {
1066  Delegate[] list = handler.GetInvocationList();
1067  foreach (DeleteUserInventoryHandler h in list)
1068  {
1069  if (h(itemID, userID) == false)
1070  return false;
1071  }
1072  }
1073  return true;
1074  }
1075 
1076  public bool CanTransferUserInventory(UUID itemID, UUID userID, UUID recipientID)
1077  {
1078  TransferUserInventoryHandler handler = OnTransferUserInventory;
1079  if (handler != null)
1080  {
1081  Delegate[] list = handler.GetInvocationList();
1082  foreach (TransferUserInventoryHandler h in list)
1083  {
1084  if (h(itemID, userID, recipientID) == false)
1085  return false;
1086  }
1087  }
1088  return true;
1089  }
1090 
1091  public bool CanTeleport(UUID userID)
1092  {
1093  TeleportHandler handler = OnTeleport;
1094  if (handler != null)
1095  {
1096  Delegate[] list = handler.GetInvocationList();
1097  foreach (TeleportHandler h in list)
1098  {
1099  if (h(userID, m_scene) == false)
1100  return false;
1101  }
1102  }
1103  return true;
1104  }
1105 
1106  public bool CanControlPrimMedia(UUID userID, UUID primID, int face)
1107  {
1108  ControlPrimMediaHandler handler = OnControlPrimMedia;
1109  if (handler != null)
1110  {
1111  Delegate[] list = handler.GetInvocationList();
1112  foreach (ControlPrimMediaHandler h in list)
1113  {
1114  if (h(userID, primID, face) == false)
1115  return false;
1116  }
1117  }
1118  return true;
1119  }
1120 
1121  public bool CanInteractWithPrimMedia(UUID userID, UUID primID, int face)
1122  {
1123  InteractWithPrimMediaHandler handler = OnInteractWithPrimMedia;
1124  if (handler != null)
1125  {
1126  Delegate[] list = handler.GetInvocationList();
1127  foreach (InteractWithPrimMediaHandler h in list)
1128  {
1129  if (h(userID, primID, face) == false)
1130  return false;
1131  }
1132  }
1133  return true;
1134  }
1135  }
1136 }
delegate bool DelinkObjectHandler(UUID user, UUID objectID)
bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID)
TransferUserInventoryHandler OnTransferUserInventory
delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene)
delegate bool EditUserInventoryHandler(UUID itemID, UUID userID)
delegate bool IsGridGodHandler(UUID user, Scene requestFromScene)
delegate bool TeleportHandler(UUID userID, Scene scene)
delegate bool DeedObjectHandler(UUID user, UUID group, Scene scene)
delegate bool TransferUserInventoryHandler(UUID itemID, UUID userID, UUID recipientID)
delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene)
delegate bool PropagatePermissionsHandler()
bool CanReturnObjects(ILandObject land, UUID user, List< SceneObjectGroup > objects)
delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene)
delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID)
delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene)
bool CanCopyUserInventory(UUID itemID, UUID userID)
Check whether the specified user is allowed to copy the given inventory item from their own inventory...
delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene)
delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene)
TransferObjectInventoryHandler OnTransferObjectInventory
delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene)
bool CanDeedParcel(UUID user, ILandObject parcel)
delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID)
InteractWithPrimMediaHandler OnInteractWithPrimMedia
delegate bool BypassPermissionsHandler()
bool CanInteractWithPrimMedia(UUID userID, UUID primID, int face)
bool CanCreateUserInventory(int invType, UUID userID)
Check whether the specified user is allowed to create the given inventory type in their inventory...
bool CanCompileScript(UUID ownerUUID, int scriptType)
delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID)
delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene)
delegate void SetBypassPermissionsHandler(bool value)
delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene)
bool CanTransferObjectInventory(UUID itemID, UUID objectID, UUID userID)
bool CanTransferObject(UUID objectID, UUID recipient)
delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene)
bool CanResetScript(UUID prim, UUID script, UUID user)
delegate bool IsEstateManagerHandler(UUID user)
delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition)
delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene)
delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager)
delegate bool RunScriptHandler(UUID script, UUID objectID, UUID user, Scene scene)
CreateObjectInventoryHandler OnCreateObjectInventory
bool CanEditObject(UUID objectID, UUID editorID)
delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand)
delegate bool IsGodHandler(UUID user, Scene requestFromScene)
bool CanRunScript(UUID script, UUID objectID, UUID user)
delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID)
bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint)
delegate bool StopScriptHandler(UUID script, UUID user, Scene scene)
bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, bool allowManager)
delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List< SceneObjectGroup > objects, Scene scene)
bool CanAbandonParcel(UUID user, ILandObject parcel)
bool CanEditUserInventory(UUID itemID, UUID userID)
Check whether the specified user is allowed to edit the given inventory item within their own invento...
delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene)
bool CanTakeCopyObject(UUID objectID, UUID userID)
delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene)
delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene)
bool CanTransferUserInventory(UUID itemID, UUID userID, UUID recipientID)
bool CanViewNotecard(UUID script, UUID objectID, UUID user)
delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene)
delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene)
uint GenerateClientFlags(UUID userID, UUID objectID)
delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID)
delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene)
bool CanMoveObject(UUID objectID, UUID moverID)
bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID)
delegate bool StartScriptHandler(UUID script, UUID user, Scene scene)
bool CanDeleteObject(UUID objectID, UUID deleter)
delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene)
delegate bool LinkObjectHandler(UUID user, UUID objectID)
bool CanReclaimParcel(UUID user, ILandObject parcel)
bool CanEditObjectInventory(UUID objectID, UUID editorID)
delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene)
bool CanSellParcel(UUID user, ILandObject parcel)
bool CanViewScript(UUID script, UUID objectID, UUID user)
delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face)
bool CanControlPrimMedia(UUID userID, UUID primID, int face)
delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face)
delegate bool IsAdministratorHandler(UUID user)
delegate bool TerraformLandHandler(UUID user, Vector3 position, Scene requestFromScene)
delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user, Scene scene)
bool CanIssueEstateCommand(UUID user, bool ownerCommand)
delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene)
delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene)
bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition)
delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID)
delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID)
bool CanEditNotecard(UUID script, UUID objectID, UUID user)
DeleteObjectInventoryHandler OnDeleteObjectInventory
delegate bool CreateUserInventoryHandler(int invType, UUID userID)
bool CanDeleteUserInventory(UUID itemID, UUID userID)
Check whether the specified user is allowed to edit the given inventory item within their own invento...
bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition)
bool CanCopyObjectInventory(UUID itemID, UUID objectID, UUID userID)
delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene)
bool CanEditScript(UUID script, UUID objectID, UUID user)
bool CanBuyLand(UUID user, ILandObject parcel)
bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID)