diff options
author | Justin Clarke Casey | 2008-11-13 20:29:41 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-13 20:29:41 +0000 |
commit | bd61b946df3b0589b03b23780a0eb3883268220d (patch) | |
tree | c1ea479c95d83b2a11e537761e3cf4b5207b3320 /OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |
parent | * refactor: rename object inventory permission checks to distinguish between ... (diff) | |
download | opensim-SC-bd61b946df3b0589b03b23780a0eb3883268220d.zip opensim-SC-bd61b946df3b0589b03b23780a0eb3883268220d.tar.gz opensim-SC-bd61b946df3b0589b03b23780a0eb3883268220d.tar.bz2 opensim-SC-bd61b946df3b0589b03b23780a0eb3883268220d.tar.xz |
* Add
public bool ExternalChecksCanCreateAvatarInventory(int invType, UUID userID)
public bool ExternalChecksCanCopyAvatarInventory(UUID itemID, UUID userID)
public bool ExternalChecksCanCopyAvatarInventory(UUID itemID, UUID userID)
public bool ExternalChecksCanDeleteAvatarInventory(UUID itemID, UUID userID)
to ExternalChecks to handle avatar inventory checks (as opposed to object inv checks).
* opensim-dev e-mail to follow concerning this shortly
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | 143 |
1 files changed, 141 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0e018e8..cc627b0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -1089,8 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1089 | 1089 | ||
1090 | /// <summary> | 1090 | /// <summary> |
1091 | /// Check whether the specified user is allowed to directly create the given inventory type in a prim's | 1091 | /// Check whether the specified user is allowed to directly create the given inventory type in a prim's |
1092 | /// inventory (e.g. the New Script button in the 1.21 Linden Lab client). This permission check does not | 1092 | /// inventory (e.g. the New Script button in the 1.21 Linden Lab client). |
1093 | /// apply to existing items that are being dragged in to that prim's inventory. | ||
1094 | /// </summary> | 1093 | /// </summary> |
1095 | /// <param name="invType"></param> | 1094 | /// <param name="invType"></param> |
1096 | /// <param name="objectID"></param> | 1095 | /// <param name="objectID"></param> |
@@ -1164,7 +1163,147 @@ namespace OpenSim.Region.Environment.Scenes | |||
1164 | 1163 | ||
1165 | return true; | 1164 | return true; |
1166 | } | 1165 | } |
1166 | |||
1167 | public delegate bool CanCreateAvatarInventory(int invType, UUID userID); | ||
1168 | private List<CanCreateAvatarInventory> CanCreateAvatarInventoryCheckFunctions | ||
1169 | = new List<CanCreateAvatarInventory>(); | ||
1170 | |||
1171 | public void addCheckCanCreateAvatarInventory(CanCreateAvatarInventory delegateFunc) | ||
1172 | { | ||
1173 | if (!CanCreateAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1174 | CanCreateAvatarInventoryCheckFunctions.Add(delegateFunc); | ||
1175 | } | ||
1176 | |||
1177 | public void removeCheckCanCreateAvatarInventory(CanCreateAvatarInventory delegateFunc) | ||
1178 | { | ||
1179 | if (CanCreateAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1180 | CanCreateAvatarInventoryCheckFunctions.Remove(delegateFunc); | ||
1181 | } | ||
1182 | |||
1183 | /// <summary> | ||
1184 | /// Check whether the specified user is allowed to create the given inventory type in their inventory. | ||
1185 | /// </summary> | ||
1186 | /// <param name="invType"></param> | ||
1187 | /// <param name="userID"></param> | ||
1188 | /// <returns></returns> | ||
1189 | public bool ExternalChecksCanCreateAvatarInventory(int invType, UUID userID) | ||
1190 | { | ||
1191 | foreach (CanCreateAvatarInventory check in CanCreateAvatarInventoryCheckFunctions) | ||
1192 | { | ||
1193 | if (check(invType, userID) == false) | ||
1194 | { | ||
1195 | return false; | ||
1196 | } | ||
1197 | } | ||
1198 | |||
1199 | return true; | ||
1200 | } | ||
1201 | |||
1202 | public delegate bool CanEditAvatarInventory(UUID itemID, UUID userID); | ||
1203 | private List<CanEditAvatarInventory> CanEditAvatarInventoryCheckFunctions | ||
1204 | = new List<CanEditAvatarInventory>(); | ||
1205 | |||
1206 | public void addCheckCanEditAvatarInventory(CanEditAvatarInventory delegateFunc) | ||
1207 | { | ||
1208 | if (!CanEditAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1209 | CanEditAvatarInventoryCheckFunctions.Add(delegateFunc); | ||
1210 | } | ||
1167 | 1211 | ||
1212 | public void removeCheckCanEditAvatarInventory(CanEditAvatarInventory delegateFunc) | ||
1213 | { | ||
1214 | if (CanEditAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1215 | CanEditAvatarInventoryCheckFunctions.Remove(delegateFunc); | ||
1216 | } | ||
1217 | |||
1218 | /// <summary> | ||
1219 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. | ||
1220 | /// </summary> | ||
1221 | /// <param name="itemID"></param> | ||
1222 | /// <param name="userID"></param> | ||
1223 | /// <returns></returns> | ||
1224 | public bool ExternalChecksCanEditAvatarInventory(UUID itemID, UUID userID) | ||
1225 | { | ||
1226 | foreach (CanEditAvatarInventory check in CanEditAvatarInventoryCheckFunctions) | ||
1227 | { | ||
1228 | if (check(itemID, userID) == false) | ||
1229 | { | ||
1230 | return false; | ||
1231 | } | ||
1232 | } | ||
1233 | |||
1234 | return true; | ||
1235 | } | ||
1236 | |||
1237 | public delegate bool CanCopyAvatarInventory(UUID itemID, UUID userID); | ||
1238 | private List<CanCopyAvatarInventory> CanCopyAvatarInventoryCheckFunctions | ||
1239 | = new List<CanCopyAvatarInventory>(); | ||
1240 | |||
1241 | public void addCheckCanCopyAvatarInventory(CanCopyAvatarInventory delegateFunc) | ||
1242 | { | ||
1243 | if (!CanCopyAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1244 | CanCopyAvatarInventoryCheckFunctions.Add(delegateFunc); | ||
1245 | } | ||
1246 | |||
1247 | public void removeCheckCanCopyAvatarInventory(CanCopyAvatarInventory delegateFunc) | ||
1248 | { | ||
1249 | if (CanCopyAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1250 | CanCopyAvatarInventoryCheckFunctions.Remove(delegateFunc); | ||
1251 | } | ||
1252 | |||
1253 | /// <summary> | ||
1254 | /// Check whether the specified user is allowed to copy the given inventory item from their own inventory. | ||
1255 | /// </summary> | ||
1256 | /// <param name="itemID"></param> | ||
1257 | /// <param name="userID"></param> | ||
1258 | /// <returns></returns> | ||
1259 | public bool ExternalChecksCanCopyAvatarInventory(UUID itemID, UUID userID) | ||
1260 | { | ||
1261 | foreach (CanCopyAvatarInventory check in CanCopyAvatarInventoryCheckFunctions) | ||
1262 | { | ||
1263 | if (check(itemID, userID) == false) | ||
1264 | { | ||
1265 | return false; | ||
1266 | } | ||
1267 | } | ||
1268 | |||
1269 | return true; | ||
1270 | } | ||
1271 | |||
1272 | public delegate bool CanDeleteAvatarInventory(UUID itemID, UUID userID); | ||
1273 | private List<CanDeleteAvatarInventory> CanDeleteAvatarInventoryCheckFunctions | ||
1274 | = new List<CanDeleteAvatarInventory>(); | ||
1275 | |||
1276 | public void addCheckCanDeleteAvatarInventory(CanDeleteAvatarInventory delegateFunc) | ||
1277 | { | ||
1278 | if (!CanDeleteAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1279 | CanDeleteAvatarInventoryCheckFunctions.Add(delegateFunc); | ||
1280 | } | ||
1281 | |||
1282 | public void removeCheckCanDeleteAvatarInventory(CanDeleteAvatarInventory delegateFunc) | ||
1283 | { | ||
1284 | if (CanDeleteAvatarInventoryCheckFunctions.Contains(delegateFunc)) | ||
1285 | CanDeleteAvatarInventoryCheckFunctions.Remove(delegateFunc); | ||
1286 | } | ||
1287 | |||
1288 | /// <summary> | ||
1289 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. | ||
1290 | /// </summary> | ||
1291 | /// <param name="itemID"></param> | ||
1292 | /// <param name="userID"></param> | ||
1293 | /// <returns></returns> | ||
1294 | public bool ExternalChecksCanDeleteAvatarInventory(UUID itemID, UUID userID) | ||
1295 | { | ||
1296 | foreach (CanDeleteAvatarInventory check in CanDeleteAvatarInventoryCheckFunctions) | ||
1297 | { | ||
1298 | if (check(itemID, userID) == false) | ||
1299 | { | ||
1300 | return false; | ||
1301 | } | ||
1302 | } | ||
1303 | |||
1304 | return true; | ||
1305 | } | ||
1306 | |||
1168 | public delegate bool CanTeleport(UUID userID); | 1307 | public delegate bool CanTeleport(UUID userID); |
1169 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); | 1308 | private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); |
1170 | 1309 | ||