my $user = App::User->load( $someid ); if ($user->can_modify) { $app->modify_document( \%args ); } else { $app->error( 'Access denied: you are not allowed to modify documents' ); }