Sulu\Component\Security\Authorization\MaskConverterInterface::convertPermissionsToArray PHP Method

convertPermissionsToArray() public method

Converts the given permissions from the numerical to the array representation.
public convertPermissionsToArray ( integer $permissions ) : array
$permissions integer
return array
    public function convertPermissionsToArray($permissions);

Usage Example

 /**
  * @dataProvider provideObjectIdentifiers
  */
 public function testGetPermissions($objectId, $objectType, $objectIdentifier)
 {
     $ace1 = $this->prophesize(EntryInterface::class);
     $ace1->getSecurityIdentity()->willReturn($this->securityIdentity);
     $ace1->getMask()->willReturn(64);
     $this->acl->getObjectAces()->willReturn([$ace1->reveal()]);
     $this->maskConverter->convertPermissionsToArray(64)->willReturn(['view' => true]);
     $this->aclProvider->findAcl(new ObjectIdentity($objectIdentifier, $objectType))->willReturn($this->acl->reveal());
     $permissions = $this->accessControlManager->getPermissions($objectType, $objectId);
     $this->assertEquals(true, $permissions['ROLE_SULU_ADMINISTRATOR']['view']);
 }
All Usage Examples Of Sulu\Component\Security\Authorization\MaskConverterInterface::convertPermissionsToArray