Feature #27698

Roles should use an adequate data type to get persisted as entities

Added by Johannes K about 4 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2011-06-26
Priority:Should have Due date:
Assigned To:Rens Admiraal % Done:

100%

Category:Security
Target version:TYPO3 Flow Base Distribution - 2.0
PHP Version: Complexity:
Has patch:No

Description

At the moment the roles of an account get saved as a php-serialized array inside "flow3_security_account", e.g.:

a:2:{i:0;s:12:"Adminstrator";i:1;s:4:"User";}

This is due to (in Packages/Framework/FLOW3/Classes/Security/Policy/Role.php)

/**
 * @var array
 */
protected $roles = array();

this should be something like this (untested, just to transport the idea, I have no idea of Doctrine)

/**
 * @var \Doctrine\Common\Collections\ArrayCollection<\F3\FLOW3\Security\Policy\Role>
 * @ManyToMany
 */
protected $roles = array();

so that they will get persisted as the already prepared entities \F3\FLOW3\Security\Policy\Role.


Related issues

related to TYPO3.Flow - Bug #28862: Inconsistent handling of roles as objects and strings in ... Resolved 2011-08-09

Associated revisions

Revision f0776fb3
Added by Karsten Dambekalns over 2 years ago

[!!!][FEATURE] Handle roles consistently as objects

With this change roles are consistently used as objects.

To prevent naming conflicts between roles from different packages the
package key is added to the role names.

The handling of roles now is more strict and does not allow the use of
not configured (non-existent) roles anymore.

Roles are now referenced as real instances instead of their string
identifiers in models. Roles which were defined in policies are now
automatically mirrored to the RoleRepository (usually stored as a
table in a database).

The getRoles() method has been removed from TokenInterface.

Change-Id: I39f335baa01fbe9b883e98e85cb1f063bbaf5744
Resolves: #28862
Resolves: #43578
Related: #37451
Related: #27698
Releases: 2.0, master

Revision 28e52aa8
Added by Karsten Dambekalns over 2 years ago

[!!!][FEATURE] Handle roles consistently as objects

With this change roles are consistently used as objects.

To prevent naming conflicts between roles from different packages the
package key is added to the role names.

The handling of roles now is more strict and does not allow the use of
not configured (non-existent) roles anymore.

Roles are now referenced as real instances instead of their string
identifiers in models. Roles which were defined in policies are now
automatically mirrored to the RoleRepository (usually stored as a
table in a database).

The getRoles() method has been removed from TokenInterface.

Change-Id: I39f335baa01fbe9b883e98e85cb1f063bbaf5744
Resolves: #28862
Resolves: #43578
Related: #37451
Related: #27698
Releases: 2.0, master

History

#1 Updated by Christopher Hlubek almost 4 years ago

This is due to inconsistent handling of Roles as strings or objects inside TYPO3\FLOW3\Security\Account. And the roles mapping would have to change, too.

#2 Updated by Rens Admiraal almost 3 years ago

  • Assigned To set to Rens Admiraal
  • Has patch set to No

#3 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from New to Under Review
  • Target version set to 2.0 beta 1

#4 Updated by Karsten Dambekalns over 2 years ago

  • Target version changed from 2.0 beta 1 to 2.1

#5 Updated by Robert Lemke about 2 years ago

  • Target version deleted (2.1)

#6 Updated by Karsten Dambekalns almost 2 years ago

  • Status changed from Under Review to Resolved
  • Target version set to 2.0
  • % Done changed from 0 to 100

Also available in: Atom PDF