mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
Adjust permission handling to string
This commit is contained in:
parent
1022824e47
commit
aae0de25f1
|
|
@ -309,7 +309,7 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @param int $permission Permission to check
|
||||
* @param int $unit Unit Unit to check (null if all are acceptable)
|
||||
* @param string $app App App to check (null if all are acceptable)
|
||||
* @param int $module Module Module to check (null if all are acceptable)
|
||||
* @param string $module Module Module to check (null if all are acceptable)
|
||||
* @param int $type Type (e.g. customer) (null if all are acceptable)
|
||||
* @param int $element (e.g. customer id) (null if all are acceptable)
|
||||
* @param int $component (e.g. address) (null if all are acceptable)
|
||||
|
|
@ -318,7 +318,7 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function hasPermission(int $permission, int $unit = null, string $app = null, int $module = null, int $type = null, $element = null, $component = null) : bool
|
||||
public function hasPermission(int $permission, int $unit = null, string $app = null, string $module = null, int $type = null, $element = null, $component = null) : bool
|
||||
{
|
||||
$app = $app !== null ? strtolower($app) : $app;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,4 +38,5 @@ abstract class LoginReturnType extends Enum
|
|||
/* public */ const TIMEOUTED = -7; /* User received a timeout and can not log in until a certain date */
|
||||
/* public */ const BANNED = -8; /* User is banned */
|
||||
/* public */ const INACTIVE = -9; /* User is inactive */
|
||||
/* public */ const EMPTY_PASSWORD = -10; /* Empty password in database */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
public function testEnums()
|
||||
{
|
||||
self::assertEquals(10, count(LoginReturnType::getConstants()));
|
||||
self::assertEquals(11, count(LoginReturnType::getConstants()));
|
||||
self::assertEquals(0, LoginReturnType::OK);
|
||||
self::assertEquals(-1, LoginReturnType::FAILURE);
|
||||
self::assertEquals(-2, LoginReturnType::WRONG_PASSWORD);
|
||||
|
|
@ -32,5 +32,6 @@ class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(-7, LoginReturnType::TIMEOUTED);
|
||||
self::assertEquals(-8, LoginReturnType::BANNED);
|
||||
self::assertEquals(-9, LoginReturnType::INACTIVE);
|
||||
self::assertEquals(-10, LoginReturnType::EMPTY_PASSWORD);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user