Skip to content

Commit bad52d2

Browse files
authored
Merge pull request #3454 from larsewi/getacls
CFE-4529: Added docs for policy function getacls()
2 parents a599017 + 22aa86c commit bad52d2

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: default
3+
title: getacls
4+
published: true
5+
---
6+
7+
[%CFEngine_function_prototype(path, type)%]
8+
9+
**Description:** Return the Access Control List (ACL) for a given file- or directory path.
10+
11+
This function returns the ACLs for a file or directory given by the `path`
12+
argument. The `type` argument indicates whether to get the __access__ or
13+
__default__ ACLs.
14+
15+
The __access__ ACLs defines the permissions for the given file or directory.
16+
I.e., who (users, groups, others) can perform what actions (read, write,
17+
execute) on that particular object.
18+
19+
The __default__ ACLs acts like a template of permissions to be inherited by
20+
objects created within that directory. Please note that only directories can
21+
have default ACLs.
22+
23+
If ACLs are not supported on the filesystem the function will return an empty
24+
list.
25+
26+
**Arguments:**
27+
28+
- `path` : Absolute path to file or directory
29+
- `type` : In the range `(access|default)`
30+
31+
**Example:**
32+
33+
```cf3
34+
bundle agent __main__
35+
{
36+
vars:
37+
"default_acls"
38+
string => getacls("/tmp/foo/", "default");
39+
"access_acls"
40+
string => getacls("/tmp/bar", "access");
41+
}
42+
```
43+
44+
**History:**
45+
46+
- Introduced in 3.27.
47+
48+
**See also:** `filestat()`

0 commit comments

Comments
 (0)