engine: resources: group: Make group edgeable

This adds the edgeable trait to the group resource and adds an
AutoEdges method which returns nil, nil. These changes are necessary
to allow UserRes to make autoedges to GroupRes.
This commit is contained in:
Jonathan Gold
2018-12-13 22:53:40 -05:00
parent bd996e441c
commit 4297a39d03

View File

@@ -41,6 +41,7 @@ const groupFile = "/etc/group"
// GroupRes is a user group resource.
type GroupRes struct {
traits.Base // add the base methods without re-implementation
traits.Edgeable
init *engine.Init
@@ -266,6 +267,11 @@ type GroupUID struct {
gid *uint32
}
// AutoEdges returns the AutoEdge interface.
func (obj *GroupRes) AutoEdges() (engine.AutoEdge, error) {
return nil, nil
}
// IFF aka if and only if they are equivalent, return true. If not, false.
func (obj *GroupUID) IFF(uid engine.ResUID) bool {
res, ok := uid.(*GroupUID)