Fix triggers for updating storage permissions when asset permissions change.
This commit is contained in:
parent
3500b6afc7
commit
ae8ed52647
3 changed files with 6 additions and 4 deletions
|
|
@ -127,7 +127,7 @@ property ownerUserId => (
|
||||||
uiLevel => 6,
|
uiLevel => 6,
|
||||||
fieldType => 'user',
|
fieldType => 'user',
|
||||||
default => '3',
|
default => '3',
|
||||||
trigger => \&_set_ownerUserId,
|
trigger => sub { shift->_set_ownerUserId(@_) } ,
|
||||||
);
|
);
|
||||||
sub _set_ownerUserId {
|
sub _set_ownerUserId {
|
||||||
return;
|
return;
|
||||||
|
|
@ -139,7 +139,7 @@ property groupIdView => (
|
||||||
uiLevel => 6,
|
uiLevel => 6,
|
||||||
fieldType => 'group',
|
fieldType => 'group',
|
||||||
default => '7',
|
default => '7',
|
||||||
trigger => \&_set_groupIdView,
|
trigger => sub { shift->_set_groupIdView(@_) },
|
||||||
);
|
);
|
||||||
sub _set_groupIdView {
|
sub _set_groupIdView {
|
||||||
return;
|
return;
|
||||||
|
|
@ -152,7 +152,7 @@ property groupIdEdit => (
|
||||||
uiLevel => 6,
|
uiLevel => 6,
|
||||||
fieldType => 'group',
|
fieldType => 'group',
|
||||||
default => '4',
|
default => '4',
|
||||||
trigger => \&_set_groupIdEdit,
|
trigger => sub { shift->_set_groupIdEdit(@_) } ,
|
||||||
);
|
);
|
||||||
sub _set_groupIdEdit {
|
sub _set_groupIdEdit {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ use Moose::Role;
|
||||||
|
|
||||||
sub _set_ownerUserId {
|
sub _set_ownerUserId {
|
||||||
my ($self, $new, $old) = @_;
|
my ($self, $new, $old) = @_;
|
||||||
|
$old ||= '';
|
||||||
if ($new ne $old) {
|
if ($new ne $old) {
|
||||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||||
}
|
}
|
||||||
|
|
@ -40,6 +41,7 @@ sub _set_ownerUserId {
|
||||||
|
|
||||||
sub _set_groupIdView {
|
sub _set_groupIdView {
|
||||||
my ($self, $new, $old) = @_;
|
my ($self, $new, $old) = @_;
|
||||||
|
$old ||= '';
|
||||||
if ($new ne $old) {
|
if ($new ne $old) {
|
||||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||||
}
|
}
|
||||||
|
|
@ -47,6 +49,7 @@ sub _set_groupIdView {
|
||||||
|
|
||||||
sub _set_groupIdEdit {
|
sub _set_groupIdEdit {
|
||||||
my ($self, $new, $old) = @_;
|
my ($self, $new, $old) = @_;
|
||||||
|
$old ||= '';
|
||||||
if ($new ne $old) {
|
if ($new ne $old) {
|
||||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,6 @@ cmp_deeply(
|
||||||
my $newRev = $asset->addRevision( { groupIdView => '7' }, time + 8 );
|
my $newRev = $asset->addRevision( { groupIdView => '7' }, time + 8 );
|
||||||
WebGUI::Test::addToCleanup( WebGUI::VersionTag->getWorking( $session ) );
|
WebGUI::Test::addToCleanup( WebGUI::VersionTag->getWorking( $session ) );
|
||||||
is( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess'), undef, "wgaccess doesn't exist" );
|
is( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess'), undef, "wgaccess doesn't exist" );
|
||||||
note( @{ $newRev->getStorageLocation->getFiles() } );
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue