aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/PermissionManager.cs
diff options
context:
space:
mode:
authorMW2008-01-16 17:31:07 +0000
committerMW2008-01-16 17:31:07 +0000
commit795a339af5accc19f5ff82b2013e79312d15eea2 (patch)
treeed548e50cba8e89e5f80a710d7a176e37e86b6c0 /OpenSim/Region/Environment/PermissionManager.cs
parent* Slowed down the sim stats update to once every 5 seconds because the networ... (diff)
downloadopensim-SC-795a339af5accc19f5ff82b2013e79312d15eea2.zip
opensim-SC-795a339af5accc19f5ff82b2013e79312d15eea2.tar.gz
opensim-SC-795a339af5accc19f5ff82b2013e79312d15eea2.tar.bz2
opensim-SC-795a339af5accc19f5ff82b2013e79312d15eea2.tar.xz
First part of changing prim's permission flags to use the correct enum (libsl PermissionMask)
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs60
1 files changed, 42 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index db1cac5..f72ae66 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -172,48 +172,72 @@ namespace OpenSim.Region.Environment
172 172
173 //return task.RootPart.ObjectFlags;task.RootPart.ObjectFlags | 173 //return task.RootPart.ObjectFlags;task.RootPart.ObjectFlags |
174 174
175 uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask; 175 uint objectOwnerMask = task.RootPart.ObjectFlags;
176 uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask; 176
177 uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask; 177 if((task.RootPart.OwnerMask & (uint)PermissionMask.Copy) != 0)
178 {
179 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectCopy;
180 }
181
182 if ((task.RootPart.OwnerMask & (uint) PermissionMask.Move) != 0)
183 {
184 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectMove;
185 }
186
187 if ((task.RootPart.OwnerMask & (uint) PermissionMask.Modify) != 0)
188 {
189 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectModify;
190 }
191
192 if ((task.RootPart.OwnerMask & (uint) PermissionMask.Transfer) != 0)
193 {
194 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectTransfer;
195 }
196
197 uint objectGroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
198 uint objectEveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
178 199
179 if (m_bypassPermissions) 200 if (m_bypassPermissions)
180 return OwnerMask; 201 return objectOwnerMask;
181 202
182 // Object owners should be able to edit their own content 203 // Object owners should be able to edit their own content
183 if (user == objectOwner) 204 if (user == objectOwner)
184 return OwnerMask; 205 {
206 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner;
207 return objectOwnerMask;
208 }
185 209
186 // Users should be able to edit what is over their land. 210 // Users should be able to edit what is over their land.
187 Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); 211 Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
188 if (parcel != null && parcel.landData.ownerID == user) 212 if (parcel != null && parcel.landData.ownerID == user)
189 return OwnerMask; 213 return objectOwnerMask;
190 214
191 // Estate users should be able to edit anything in the sim 215 // Estate users should be able to edit anything in the sim
192 if (IsEstateManager(user)) 216 if (IsEstateManager(user))
193 return OwnerMask; 217 return objectOwnerMask;
194 218
195 // Admin objects should not be editable by the above 219 // Admin objects should not be editable by the above
196 if (IsAdministrator(taskOwner)) 220 if (IsAdministrator(taskOwner))
197 return EveryoneMask; 221 return objectEveryoneMask;
198 222
199 // Admin should be able to edit anything in the sim (including admin objects) 223 // Admin should be able to edit anything in the sim (including admin objects)
200 if (IsAdministrator(user)) 224 if (IsAdministrator(user))
201 return OwnerMask; 225 return objectOwnerMask;
202 226
203 if (((EveryoneMask & PERM_MOVE) != 0) || ((EveryoneMask & PERM_COPY) != 0)) 227 if (((objectEveryoneMask & PERM_MOVE) != 0) || ((objectEveryoneMask & PERM_COPY) != 0))
204 { 228 {
205 if ((EveryoneMask & PERM_MOVE) != 0) 229 if ((objectEveryoneMask & PERM_MOVE) != 0)
206 OwnerMask &= ~PERM_MOVE; 230 objectOwnerMask &= ~PERM_MOVE;
207 231
208 if ((EveryoneMask & PERM_COPY) != 0) 232 if ((objectEveryoneMask & PERM_COPY) != 0)
209 OwnerMask &= ~PERM_COPY; 233 objectOwnerMask &= ~PERM_COPY;
210 234
211 OwnerMask &= ~PERM_MODIFY; 235 objectOwnerMask &= ~PERM_MODIFY;
212 OwnerMask &= ~PERM_TRANS; 236 objectOwnerMask &= ~PERM_TRANS;
213 237
214 return OwnerMask; 238 return objectOwnerMask;
215 } 239 }
216 return EveryoneMask; 240 return objectEveryoneMask;
217 } 241 }
218 242
219 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId) 243 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)