admin: new route and interface to manage symlink for team association exclusing certificates
This commit is contained in:
parent
2b95995104
commit
14d31737e0
6 changed files with 132 additions and 21 deletions
|
|
@ -47,3 +47,21 @@ func GetTeamSerials(dirname string, id_team int64) (serials []uint64, err error)
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetTeamAssociations(dirname string, id_team int64) (teamAssocs []string, err error) {
|
||||
// As futher comparaisons will be made with strings, convert it only one time
|
||||
str_tid := fmt.Sprintf("%d", id_team)
|
||||
|
||||
var assocs []string
|
||||
if assocs, err = GetAssociations(dirname); err != nil {
|
||||
return
|
||||
} else {
|
||||
for _, assoc := range assocs {
|
||||
var tid string
|
||||
if tid, err = os.Readlink(path.Join(dirname, assoc)); err == nil && tid == str_tid && !strings.HasPrefix(assoc, SymlinkPrefix) {
|
||||
teamAssocs = append(teamAssocs, assoc)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue