Does it make any sense to use the sfguard architecture for that purpose?
Absolutely, but you'll need to fix it up a little bit. By default, Symfony stores credentials on the session, which means that they won't get invalidated until your session expires. This is a big issue when you expect to see an immediate effect by adding someone to a group or granting them a permission.
To fix this, you'll want to do one of the following:
- Load the credentials on every request, rather than on sign in.
- When a user's credentials change, invalidate them either via a global cache setting in APC (you are using APC, right?) or a setting on the user's profile.
Either way, you're going to have to get familiar with Symfony and sfGuardDoctrine user system. Take a look at sfGuardSecurityUser::signIn
so you're familiar with how credentials work by default.
How do I check if a specific user has a spcecific permission on a specific group?
Tristan covered this pretty thoroughly. You'll also want to take a look at the sfDoctrineGuard readme. Note that for any solution in which credential changes happen live for signed in user's, you'll need to override most if not all of the methods listed by Tristan to perform some sort of invalidation.
Also, check out this related question, it may be helpful.