@@ -95,7 +95,7 @@ public static function _createACLFromJSON($data)
9595 $ acl = new self ();
9696 foreach ($ data as $ id => $ permissions ) {
9797 if (!is_string ($ id )) {
98- throw new Exception ('Tried to create an ACL with an invalid userId. ' );
98+ throw new Exception ('Tried to create an ACL with an invalid userId. ' , 104 );
9999 }
100100 foreach ($ permissions as $ accessType => $ value ) {
101101 if ($ accessType !== 'read ' && $ accessType !== 'write ' ) {
@@ -169,7 +169,8 @@ private function setAccess($accessType, $userId, $allowed)
169169 }
170170 if (!is_string ($ userId )) {
171171 throw new ParseException (
172- 'Invalid target for access control. '
172+ 'Invalid target for access control. ' ,
173+ 104
173174 );
174175 }
175176 if (!isset ($ this ->permissionsById [$ userId ])) {
@@ -219,7 +220,7 @@ private function getAccess($accessType, $userId)
219220 public function setReadAccess ($ userId , $ allowed )
220221 {
221222 if (!$ userId ) {
222- throw new Exception ('cannot setReadAccess for null userId ' );
223+ throw new Exception ('cannot setReadAccess for null userId ' , 104 );
223224 }
224225 $ this ->setAccess ('read ' , $ userId , $ allowed );
225226 }
@@ -239,7 +240,7 @@ public function setReadAccess($userId, $allowed)
239240 public function getReadAccess ($ userId )
240241 {
241242 if (!$ userId ) {
242- throw new Exception ('cannot getReadAccess for null userId ' );
243+ throw new Exception ('cannot getReadAccess for null userId ' , 104 );
243244 }
244245
245246 return $ this ->getAccess ('read ' , $ userId );
@@ -256,7 +257,7 @@ public function getReadAccess($userId)
256257 public function setWriteAccess ($ userId , $ allowed )
257258 {
258259 if (!$ userId ) {
259- throw new Exception ('cannot setWriteAccess for null userId ' );
260+ throw new Exception ('cannot setWriteAccess for null userId ' , 104 );
260261 }
261262 $ this ->setAccess ('write ' , $ userId , $ allowed );
262263 }
@@ -276,7 +277,7 @@ public function setWriteAccess($userId, $allowed)
276277 public function getWriteAccess ($ userId )
277278 {
278279 if (!$ userId ) {
279- throw new Exception ('cannot getWriteAccess for null userId ' );
280+ throw new Exception ('cannot getWriteAccess for null userId ' , 104 );
280281 }
281282
282283 return $ this ->getAccess ('write ' , $ userId );
@@ -333,7 +334,7 @@ public function getPublicWriteAccess()
333334 public function setUserReadAccess ($ user , $ allowed )
334335 {
335336 if (!$ user ->getObjectId ()) {
336- throw new Exception ('cannot setReadAccess for a user with null id ' );
337+ throw new Exception ('cannot setReadAccess for a user with null id ' , 104 );
337338 }
338339 $ this ->setReadAccess ($ user ->getObjectId (), $ allowed );
339340 }
@@ -353,7 +354,7 @@ public function setUserReadAccess($user, $allowed)
353354 public function getUserReadAccess ($ user )
354355 {
355356 if (!$ user ->getObjectId ()) {
356- throw new Exception ('cannot getReadAccess for a user with null id ' );
357+ throw new Exception ('cannot getReadAccess for a user with null id ' , 104 );
357358 }
358359
359360 return $ this ->getReadAccess ($ user ->getObjectId ());
@@ -370,7 +371,7 @@ public function getUserReadAccess($user)
370371 public function setUserWriteAccess ($ user , $ allowed )
371372 {
372373 if (!$ user ->getObjectId ()) {
373- throw new Exception ('cannot setWriteAccess for a user with null id ' );
374+ throw new Exception ('cannot setWriteAccess for a user with null id ' , 104 );
374375 }
375376 $ this ->setWriteAccess ($ user ->getObjectId (), $ allowed );
376377 }
@@ -390,7 +391,7 @@ public function setUserWriteAccess($user, $allowed)
390391 public function getUserWriteAccess ($ user )
391392 {
392393 if (!$ user ->getObjectId ()) {
393- throw new Exception ('cannot getWriteAccess for a user with null id ' );
394+ throw new Exception ('cannot getWriteAccess for a user with null id ' , 104 );
394395 }
395396
396397 return $ this ->getWriteAccess ($ user ->getObjectId ());
@@ -459,7 +460,8 @@ private static function validateRoleState($role)
459460 {
460461 if (!$ role ->getObjectId ()) {
461462 throw new Exception (
462- 'Roles must be saved to the server before they can be used in an ACL. '
463+ 'Roles must be saved to the server before they can be used in an ACL. ' ,
464+ 104
463465 );
464466 }
465467 }
0 commit comments