summaryrefslogtreecommitdiff
path: root/indra/newview/llenvmanager.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-06-06 23:46:35 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-06-06 23:46:35 +0300
commit9f4779e09997e70246c3c0c5f831bf55d4ed6a4f (patch)
tree29301dbec6cb55f921911146730df7fb5250dc85 /indra/newview/llenvmanager.cpp
parent88407a0f0c19f1ee36c176f2fdc2117646d65b80 (diff)
STORM-1255 WIP Made the check for region permissions reusable.
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r--indra/newview/llenvmanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index 8e4b7197d6..58d1349a63 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -923,6 +923,17 @@ boost::signals2::connection LLEnvManagerNew::setRegionSettingsAppliedCallback(co
return mRegionSettingsAppliedSignal.connect(cb);
}
+// static
+bool LLEnvManagerNew::canEditRegionSettings()
+{
+ LLViewerRegion* region = gAgent.getRegion();
+ BOOL owner_or_god = gAgent.isGodlike() || (region && region->getOwner() == gAgent.getID());
+ BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager());
+
+ LL_DEBUGS("Windlight") << "Can edit region settings: " << (bool) owner_or_god_or_manager << LL_ENDL;
+ return owner_or_god_or_manager;
+}
+
void LLEnvManagerNew::onRegionCrossing()
{
LL_DEBUGS("Windlight") << "Crossed region" << LL_ENDL;