-
Notifications
You must be signed in to change notification settings - Fork 75
CFE-4529: Added docs for policy function getacls() #3454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
layout: default | ||
title: getacls | ||
published: true | ||
--- | ||
|
||
[%CFEngine_function_prototype(path, type)%] | ||
|
||
**Description:** Return the Access Control List (ACL) for a given file- or directory path. | ||
|
||
This function returns the ACLs for a file or directory given by the `path` | ||
argument. The `type` argument indicates whether to get the __access__ or | ||
__default__ ACLs. | ||
|
||
The __access__ ACLs defines the permissions for the given file or directory. | ||
I.e., who (users, groups, others) can perform what actions (read, write, | ||
execute) on that particular object. | ||
|
||
The __default__ ACLs acts like a template of permissions to be inherited by | ||
objects created within that directory. Please note that only directories can | ||
have default ACLs. | ||
|
||
If ACLs are not supported on the filesystem the function will return an empty | ||
list. | ||
|
||
**Arguments:** | ||
|
||
- `path` : Absolute path to file or directory | ||
- `type` : In the range `(access|default)` | ||
|
||
**Example:** | ||
|
||
```cf3 | ||
bundle agent __main__ | ||
{ | ||
vars: | ||
"default_acls" | ||
string => getacls("/tmp/foo/", "default"); | ||
"access_acls" | ||
string => getacls("/tmp/bar", "access"); | ||
} | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to show the expected output (you can add it to getacls.cf, cf. my previous comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that it would be nice to show the expected output. But, then you need to be able to make sure you know what the result will be for whatever system doc build happens on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably won't be so easy given that ACLs are not supported on all platforms and file systems |
||
|
||
**History:** | ||
|
||
- Introduced in 3.27. | ||
|
||
**See also:** `filestat()` |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could use the docs macro to include the example you have created in the other PR like it has been done for other functions
For example: