summaryrefslogtreecommitdiff
path: root/internal/server/instituteaccess.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/instituteaccess.go')
-rw-r--r--internal/server/instituteaccess.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go
index c5b58ef..f2669b8 100644
--- a/internal/server/instituteaccess.go
+++ b/internal/server/instituteaccess.go
@@ -21,6 +21,13 @@ type InstituteAccessServers struct {
CurrentURL string `json:"current_url"`
}
+func (servers *Servers) GetInstituteAccess(url string) (*InstituteAccessServer, error) {
+ if server, ok := servers.InstituteServers.Map[url]; ok {
+ return server, nil
+ }
+ return nil, &types.WrappedErrorMessage{Message: "failed to get institute access server", Err: fmt.Errorf("No institute access server with URL: %s", url)}
+}
+
func (servers *Servers) RemoveInstituteAccess(url string) {
servers.InstituteServers.Remove(url)
}