Force inheritPermissionsFromParent to work in all import scenarios. Also, fix handling of clearPackageFlag and setDefaultTemplate.

This commit is contained in:
Colin Kuskie 2010-03-15 11:22:08 -07:00
parent 5869cfe903
commit 0a005834b8
2 changed files with 10 additions and 7 deletions

View file

@ -2,6 +2,7 @@
- fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero)
- fixed #11472: View Calendar Month help missing
- fixed #11471: Errors in Calendar Event Edit template (Dale Trexel / U of MN Law School)
- fixed #11475: Inherit permissions on imported package fails if asset already exists.
7.9.0
- added #11383: AJAX username checks at registration (Luke Robinson / Orchard Solutions)

View file

@ -128,6 +128,14 @@ from the asset where it is deployed.
Forces the package to ignore the revisionDate inside it. This makes the imported package the
latest revision of an asset.
=head4 clearPackageFlag
Clears the isPackage flag on the incoming asset.
=head4 setDefaultTemplate
Set the isDefault flag on the incoming asset. Really only works on templates.
=cut
sub importAssetData {
@ -181,16 +189,10 @@ sub importAssetData {
};
if (defined $asset) { # create a new revision of an existing asset
$error->info("Creating a new revision of asset $id");
$asset = $asset->addRevision($data->{properties}, $version, {skipAutoCommitWorkflows => 1});
$asset = $asset->addRevision(\%properties, $version, {skipAutoCommitWorkflows => 1});
}
else { # add an entirely new asset
$error->info("Adding $id that didn't previously exist.");
my %properties = %{ $data->{properties} };
if ($options->{inheritPermissions}) {
$properties{ownerUserId} = $self->get('ownerUserId');
$properties{groupIdView} = $self->get('groupIdView');
$properties{groupIdEdit} = $self->get('groupIdEdit');
}
$asset = $self->addChild(\%properties, $id, $version, {skipAutoCommitWorkflows => 1});
}
}