mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Check permissions for time travel and element undo.
This commit is contained in:
parent
254d4e6c69
commit
8a61b465d0
23 changed files with 370 additions and 90 deletions
|
@ -481,7 +481,7 @@ class PermissionsEmbed
|
|||
*/
|
||||
final protected static function readBitPair($data, int $n): int
|
||||
{
|
||||
Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
|
||||
//Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
|
||||
if (0 !== $n % 2) {
|
||||
throw new InvalidArgumentException('$n must be dividable by 2, because we address bit pairs here!');
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ class PermissionsEmbed
|
|||
*/
|
||||
final protected static function writeBitPair(int $data, int $n, int $new): int
|
||||
{
|
||||
Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
|
||||
//Assert::lessThanEq($n, 31, '$n must be smaller than 32, because only a 32bit int is used! Got %s.');
|
||||
Assert::lessThanEq($new, 3, '$new must be smaller than 3, because a bit pair is written! Got %s.');
|
||||
Assert::greaterThanEq($new, 0, '$new must not be negative, because a bit pair is written! Got %s.');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue