gitlab.com/evatix-go/core@v1.3.55/chmodhelper/ParseRwxOwnerGroupOtherInstructionToRwxVariableWrapper.go (about)

     1  package chmodhelper
     2  
     3  import "gitlab.com/evatix-go/core/chmodhelper/chmodins"
     4  
     5  func ParseRwxOwnerGroupOtherToRwxVariableWrapper(
     6  	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
     7  ) (
     8  	*RwxVariableWrapper, error,
     9  ) {
    10  	if rwxOwnerGroupOther == nil {
    11  		return nil, rwxInstructionNilErr
    12  	}
    13  
    14  	ownerVarAttr, ownerErr := ParseRwxToVarAttribute(rwxOwnerGroupOther.Owner)
    15  
    16  	if ownerErr != nil {
    17  		return nil, ownerErr
    18  	}
    19  
    20  	groupVarAttr, groupErr := ParseRwxToVarAttribute(rwxOwnerGroupOther.Group)
    21  
    22  	if groupErr != nil {
    23  		return nil, groupErr
    24  	}
    25  
    26  	otherVarAttr, otherErr := ParseRwxToVarAttribute(rwxOwnerGroupOther.Other)
    27  
    28  	if otherErr != nil {
    29  		return nil, otherErr
    30  	}
    31  
    32  	rawInput := ParseRwxInstructionToStringRwx(
    33  		rwxOwnerGroupOther,
    34  		false)
    35  
    36  	isFixedType := ownerVarAttr.IsFixedType() &&
    37  		groupVarAttr.IsFixedType() &&
    38  		otherVarAttr.IsFixedType()
    39  
    40  	return &RwxVariableWrapper{
    41  		rawInput:    rawInput,
    42  		isFixedType: isFixedType,
    43  		Owner:       *ownerVarAttr,
    44  		Group:       *groupVarAttr,
    45  		Other:       *otherVarAttr,
    46  	}, nil
    47  }