File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package ace
2
2
3
3
import (
4
4
"fmt"
5
+ "slices"
5
6
"strings"
6
7
7
8
"github.com/p0dalirius/winacl/identity"
@@ -412,6 +413,27 @@ func (ace *AccessControlEntry) Parse(RawBytes []byte) {
412
413
ace .RawBytes = ace .RawBytes [:ace .RawBytesSize ]
413
414
}
414
415
416
+ // IsInherited checks whether the Access Control Entry (ACE) is inherited
417
+ // from a parent object. This is determined by checking if the ACE_FLAG_INHERITED
418
+ // is present in the Flags.Values slice of the ACE header.
419
+ //
420
+ // Returns:
421
+ // - bool: true if the ACE is inherited, false otherwise.
422
+ func (ace * AccessControlEntry ) IsInherited () bool {
423
+ return slices .Contains (ace .Header .Flags .Values , ACE_FLAG_INHERITED )
424
+ }
425
+
426
+ // HasFlag checks if a specific flag is set within the ACE's flags.
427
+ //
428
+ // Parameters:
429
+ // - flag: The integer value of the flag to check.
430
+ //
431
+ // Returns:
432
+ // - bool: true if the specified flag is set, false otherwise.
433
+ func (ace * AccessControlEntry ) HasFlag (flag uint8 ) bool {
434
+ return slices .Contains (ace .Header .Flags .Values , flag )
435
+ }
436
+
415
437
func (ace * AccessControlEntry ) Describe (indent int ) {
416
438
indentPrompt := strings .Repeat (" │ " , indent )
417
439
You can’t perform that action at this time.
0 commit comments