public static function add($request, $match)
    {
        $perm = Pluf_Shortcuts_GetObjectOr404('User_Role', $match['role_id']);
        if (array_key_exists('user_id', $match)) {
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $match['user_id']);
        } elseif (array_key_exists('user_id', $request->REQUEST)) {
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $request->REQUEST['user_id']);
        } elseif (array_key_exists('login', $request->REQUEST)) {
            $user = new User_Account();
            $user = $user->getUser($request->REQUEST['login']);
        }
        if (! isset($user) || $user->isAnonymous()) {
            throw new Pluf_HTTP_Error404(__('User not found'));
        }
        $perm->setAssoc($user);
        return $user;
    }
public static function add($request, $match)
    {
        $perm = Pluf_Shortcuts_GetObjectOr404('User_Role', $match['role_id']);
        if (array_key_exists('user_id', $match)) {
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $match['user_id']);
        } elseif (array_key_exists('user_id', $request->REQUEST)) {
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $request->REQUEST['user_id']);
        } elseif (array_key_exists('login', $request->REQUEST)) {
            $user = new User_Account();
            $user = $user->getUser($request->REQUEST['login']);
        }
        if (! isset($user) || $user->isAnonymous()) {
            throw new Pluf_HTTP_Error404(__('User not found'));
        }
        $perm->setAssoc($user);
        return $user;
    }
public static function add ( $ request , $ match ) { $ perm = Pluf_Shortcuts_GetObjectOr404 ( 'User_Role' , $ match [ 'role_id' ] ) ; if ( array_key_exists ( 'user_id' , $ match ) ) { $ user = Pluf_Shortcuts_GetObjectOr404 ( 'User_Account' , $ match [ 'user_id' ] ) ; } elseif ( array_key_exists ( 'user_id' , $ request -> REQUEST ) ) { $ user = Pluf_Shortcuts_GetObjectOr404 ( 'User_Account' , $ request -> REQUEST [ 'user_id' ] ) ; } elseif ( array_key_exists ( 'login' , $ request -> REQUEST ) ) { $ user = new User_Account ( ) ; $ user = $ user -> getUser ( $ request -> REQUEST [ 'login' ] ) ; } if ( ! isset ( $ user ) || $ user -> isAnonymous ( ) ) { throw new Pluf_HTTP_Error404 ( __ ( 'User not found' ) ) ; } $ perm -> setAssoc ( $ user ) ; return $ user ; }
Add new user to a role.
In other word, grant a role to a user.
Id of added user should be specified in request.

@param Pluf_HTTP_Request $request
@param array $match
Add new user to a role . In other word grant a role to a user . Id of added user should be specified in request .