Development

#2618 ([sfGuard] Add a magic method to sfGuardUser to detect 'isXXX' method calls)

You must first sign up to be able to contribute.

Ticket #2618 (new enhancement)

Opened 8 months ago

[sfGuard] Add a magic method to sfGuardUser to detect 'isXXX' method calls

Reported by: francois Assigned to: fabien
Priority: minor Milestone:
Component: sfGuardPlugin Version: 1.0.9
Keywords: Cc:
Qualification: Unreviewed

Description

For now, it is possible to check if a sfGuardUser has a permission with the hasPermission() method. But this method requires a parameter, so if I want to check if a user is moderator, I must call:

$user->hasPermission('moderator');

It would be very convenient to be able to call instead:

$user->isModerator();

or even:

$user->getIsModerator();

The most obvious benefit being that the sfGuardUser module could display a list of users with permission columns, making user management way easier.