[gold-users] Antwort: Re: Gold showing newly created projects to all users with mybalance/gbalance ?

Scott Jackson scottmo at adaptivecomputing.com
Tue Jul 20 09:27:15 MDT 2010


I thought I would offer the reason for this behavior. In Gold 2.x, it is 
possible to create non-viable accounts. If you create an account for 
which you setup the AccountUser as MEMBERS, but the project does not 
have any user members defined, that account is non-viable, will not be 
picked up in the join SELECT and may not even show up properly in your 
list of accounts.

In gmkproject, we signal to the Project Create routine whether or not 
users were defined for the project when it was created by sending an 
AccountUsers option.

    $request->setOption("AccountUsers", "MEMBERS") if defined $users;

In the backend, if account.autogen is set, we will create an account, 
and the AccountUser will be set to ANY if no users have been set for the 
project yet to avoid it becoming nonviable. If users were specify in the 
gmkproject command, then we know it has users and we can safely set it 
to MEMBERS.

Here is an extract of the code where we auto-generate the account:

        # Create a default account if we resolved to do so
        if ($createAccount)
        {
            my $project = $request->getAssignmentValue("Name");
    # Use the AccountUsers option value if specified,
    # otherwise, use ANY to avoid creating a non-viable account.
    # The goal here is to create the AccountUser as MEMBERS only if we 
will be
    # immediately adding users to the project (known by gmkproject), 
since if we
    # create it as MEMBERS and do not add any project members, the 
account will
    # not be viable, and a subsequent call to gdeposit -p $project 
(which uses
    # UseRules) will auto-generate a second account (with AccountUser ANY).
            my $user = $request->getOptionValue("AccountUsers") || "ANY";

            # Create the account
            my $subRequest = new Gold::Request(
                database    => $database,
                object      => "Account",
                action      => "Create",
                actor       => $config->get_property("super.user", 
$SUPER_USER),
                assignments => [
                    new Gold::Assignment(name => "Name", value => $project),
                    new Gold::Assignment(
                        name  => "Description",
                        value => "Auto-generated"
                    )
                ]
            );
            my $subResponse = Gold::Bank->create($subRequest, $requestId);

This should explain why adding the dummy user modified the behavior.

Scott



RNothdurft at spirit21.de wrote:
> Hi,
>
> you don't have to create an extra dummy-user, you can use the 
> MEMBERS-user directly:
>
> gmkproject -u MEMBERS Test-Ignore
>
> If you've already got accounts with the ANY-user in you can create a 
> new AccountUser-relation and delete the old one with gold-shell 
> (modification doesn't work by default, cause Name-field is fixed):
>
> ./goldsh AccountUser Create Account=11 Name=MEMBERS
> ./goldsh AccountUser Delete Account==11 Name==ANY
>
> Kind regards,
> Richard
>
>
> Richard Nothdurft
> DHBW-Student der SPIRIT/21 AG
> Otto-Lilienthal-Str. 36, 71034 Böblingen
> Mobil: 0177/7427024
> E-Mail: rnothdurft at spirit21.de
> Internet: http://www.spirit21.de <http://www.spirit21.de/>
>
>
>
> *Christopher Samuel <samuel at unimelb.edu.au>*
> Gesendet von: gold-users-bounces at supercluster.org
>
> 20.07.2010 08:01
> Bitte antworten an
> Gold Users Mailing List <gold-users at supercluster.org>
>
>
> 	
> An
> 	gold-users at supercluster.org
> Kopie
> 	
> Thema
> 	Re: [gold-users] Gold showing newly created projects to all users 
> with mybalance/gbalance ?
>
>
>
> 	
>
>
>
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 20/07/10 12:04, Steve Crusan wrote:
>
> > If you do a glsaccount, what is the output for the new project?
>
> That's nailed it, thanks!
>
> Problem account says:
>
> # glsaccount -p VR0019
> Id  Name   Amount Projects Users Machines Description
> - --- ------ ------ -------- ----- -------- --------------
> 373 VR0019      0 VR0019   ANY   ANY      Auto-generated
>
> Working account says:
>
> # glsaccount -p VR0018
> Id  Name   Amount    Projects Users   Machines Description
> - --- ------ --------- -------- ------- -------- --------------
> 325 VR0018         0 VR0018   MEMBERS ANY      Auto-Generated
>
> Great - should be able to fix it from there, thanks so much Steve!
>
> - --
> Christopher Samuel - Senior Systems Administrator
> VLSCI - Victorian Life Sciences Computational Initiative
> Email: samuel at unimelb.edu.au Phone: +61 (0)3 903 55545
>         http://www.vlsci.unimelb.edu.au/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkxFO8sACgkQO2KABBYQAh/XxQCfSM3Xud1lYc4dFV9UFTE3vJeh
> 2qIAnjAfwmcxDyTI2rFCnXvzv3KovgT0
> =iRFn
> -----END PGP SIGNATURE-----
> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users
>
>
>
> SPIRIT/21 AG
>
> Sitz der Gesellschaft: Böblingen
> Vorstand: Dietmar Wendt (Vorsitzender), Philipp Steffen, Joachim Gutheil
> Vorsitzender des Aufsichtsrates: Siegfried J. Althaus
> Registergericht: Amtsgericht Stuttgart, Registernummer: HRB 244681
> Umsatzsteuer-Identifikationsnummer: DE 198412560
> ------------------------------------------------------------------------
>
> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users
>   


More information about the gold-users mailing list