</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <retrieve permission="VIEW_USER" context_field="home_ou" />
+ <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
</actions>
</permacrud>
</class>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <retrieve permission="VIEW_USER">
+ <retrieve permission="VIEW_USER user_request.view">
<context link="usr" field="home_ou" />
</retrieve>
</actions>
},
{ atomic : true }
).then(function(users) {
- var usr = egCore.idl.toHash(users[0]);
- aur_obj.usr = usr.id;
- aur_obj.pickup_lib = egCore.idl.toHash(
- egOrg.get(usr.home_ou.id)
- );
- aur_obj.phone_notify = usr.day_phone;
- angular.forEach(usr.settings, function(s) {
- if (s.name == 'opac.hold_notify') {
- if (s.value.match('phone')) {
- extra.phone_notify = true;
+ if (users.length > 0) {
+ var usr = egCore.idl.toHash(users[0]);
+ aur_obj.usr = usr.id;
+ aur_obj.pickup_lib = egCore.idl.toHash(
+ egOrg.get(usr.home_ou.id)
+ );
+ aur_obj.phone_notify = usr.day_phone;
+ angular.forEach(usr.settings, function(s) {
+ if (s.name == 'opac.hold_notify') {
+ if (s.value.match('phone')) {
+ extra.phone_notify = true;
+ }
+ if (s.value.match('email')) {
+ aur_obj.email_notify = true;
+ }
}
- if (s.value.match('email')) {
- aur_obj.email_notify = true;
+ if (s.name == 'opac.default_phone') {
+ aur_obj.phone_notify = s.value.replace(/^"/,'').replace(/"$/,'');
}
- }
- if (s.name == 'opac.default_phone') {
- aur_obj.phone_notify = s.value.replace(/^"/,'').replace(/"$/,'');
- }
- if (s.name == 'opac.default_pickup_location') {
- aur_obj.pickup_lib = egCore.idl.toHash(
- egOrg.get(s.value)
- );
- }
- });
+ if (s.name == 'opac.default_pickup_location') {
+ aur_obj.pickup_lib = egCore.idl.toHash(
+ egOrg.get(s.value)
+ );
+ }
+ });
+ }
return { 'request' : aur_obj, 'extra' : extra };
});
} else {