Refactor code for updating storage location file permissions into a Role.
This commit is contained in:
parent
abaeab36e0
commit
90facc46a9
4 changed files with 60 additions and 60 deletions
|
|
@ -72,27 +72,8 @@ sub _set_storageId {
|
|||
sub _storageid_deleteFileUrl {
|
||||
return shift->session->url->page("func=deleteFile;filename=");
|
||||
}
|
||||
sub _set_ownerUserId {
|
||||
my ($self, $new, $old) = @_;
|
||||
if ($new ne $old) {
|
||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||
}
|
||||
}
|
||||
|
||||
sub _set_groupIdView {
|
||||
my ($self, $new, $old) = @_;
|
||||
if ($new ne $old) {
|
||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||
}
|
||||
}
|
||||
|
||||
sub _set_groupIdEdit {
|
||||
my ($self, $new, $old) = @_;
|
||||
if ($new ne $old) {
|
||||
$self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit);
|
||||
}
|
||||
}
|
||||
|
||||
with 'WebGUI::AssetRole::SetStoragePermissions';
|
||||
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::HTML;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue