Specifically, when using permFilter, include locations at ancestors of
permitted OUs.
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
setFilterOrgs(): Promise<number[]> {
if (this.permFilter) {
return this.perm.hasWorkPermAt([this.permFilter], true)
- .then(values => this.filterOrgs = values[this.permFilter]);
+ .then(values => {
+ this.filterOrgs = values[this.permFilter];
+ // then include ancestors
+ this.filterOrgs.forEach(ou => {
+ this.org.ancestors(ou, true).forEach(anc => this.filterOrgs.push(anc));
+ });
+ return this.filterOrgs;
+ });
}
const org = this.contextOrgId || this.auth.user().ws_ou();