<field reporter:label="Transmission Format" name="transmission_format" reporter:datatype="text"/>
<field reporter:label="Auth" name="auth" reporter:datatype="bool"/>
<field reporter:label="Attrs" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
- <field reporter:label="Use Permission" name="use_perm" reporter:datatype="text"/>
+ <field reporter:label="Use Permission" name="use_perm" reporter:datatype="link"/>
</fields>
<links>
<link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
+ <link field="use_perm" reltype="has_a" key="code" map="" class="ppl"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
api_name => "open-ils.search.z3950.retrieve_services",
signature => q/
@param auth The login session key
- @param check_use_perm If true, checks the Use Perm on the services
- against the requestor
Returns a list of service names that we have config
data for
/
# What services do we have config info for?
# -------------------------------------------------------------------
sub query_services {
- my( $self, $client, $auth, $check_use_perm ) = @_;
+ my( $self, $client, $auth ) = @_;
my $e = new_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('REMOTE_Z3950_QUERY');
- return fetch_service_defs($check_use_perm,$e);
+ return fetch_service_defs($e);
}
# -------------------------------------------------------------------
# -------------------------------------------------------------------
sub fetch_service_defs {
- my $check_use_perm = shift;
my $editor_with_authtoken = shift;
my $hash = $sclient->config_value('z3950', 'services');
}
};
- # If checking use_perm, then filter out any services which the requestor
- # lacks the perm for
- if ($check_use_perm) {
- foreach my $s (keys %{ $hash }) {
- if ($$hash{$s}{use_perm}) {
- if ($U->check_perms(
- $e->requestor->id,
- $e->requestor->ws_ou,
- $$hash{$s}{use_perm}
- )) {
- delete $$hash{$s};
- }
- };
- }
+ # then filter out any services which the requestor lacks the perm for
+ foreach my $s (keys %{ $hash }) {
+ if ($$hash{$s}{use_perm}) {
+ if ($U->check_perms(
+ $e->requestor->id,
+ $e->requestor->ws_ou,
+ $$hash{$s}{use_perm}
+ )) {
+ delete $$hash{$s};
+ }
+ };
}
%services = %$hash; # cache these internally so we can actually use the db-configured sources
record_format TEXT NOT NULL DEFAULT 'FI',
transmission_format TEXT NOT NULL DEFAULT 'usmarc',
auth BOOL NOT NULL DEFAULT TRUE,
- use_perm TEXT
+ use_perm TEXT REFERENCES permission.perm_list (code)
);
COMMENT ON TABLE config.z3950_source IS $$
-- check whether patch can be applied
SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-ALTER TABLE config.z3950_source ADD COLUMN use_perm TEXT;
+ALTER TABLE config.z3950_source
+ ADD COLUMN use_perm TEXT REFERENCES permission.perm_list (code)
COMMENT ON COLUMN config.z3950_source.use_perm IS $$
If set, this permission is required for the source to be listed in the staff