This commit is contained in:
@@ -26,6 +26,19 @@ func GroupGetByName(groupname string) (Group, error) {
|
||||
return g, nil
|
||||
}
|
||||
|
||||
// GroupGetById queries the database for the specified group name
|
||||
func GroupGetById(groupId int) (Group, error) {
|
||||
var g Group
|
||||
|
||||
// Query database for matching group object
|
||||
err := db.QueryRowx("SELECT * FROM groups WHERE GroupId=?", groupId).StructScan(&g)
|
||||
if err != nil {
|
||||
return g, errors.New("group not found")
|
||||
}
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
// GroupGetByName queries the database for a group with the specified LDAP distinguishedName
|
||||
func GroupGetByLdapDn(ldapDn string) (Group, error) {
|
||||
var g Group
|
||||
|
Reference in New Issue
Block a user