Skip to content

docs: applications and authorization #5477

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

Merged
merged 15 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix: It
  • Loading branch information
mtojek committed Dec 21, 2022
commit 095a46308e874324aa55acff5b2e6e0ddacba645
2 changes: 1 addition & 1 deletion docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checks` | object | false | | Checks is a map keyed with an arbitrary string to a permission check.<br>The key can be any string that is helpful to the caller, and allows<br>multiple permission checks to be run in a single request.<br>The key ensures that each permission check has the same key in the<br>response. |
| » `[any property]` | [codersdk.AuthorizationCheck](#codersdkauthorizationcheck) | false | | » **additionalproperties** is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects. |
| » `[any property]` | [codersdk.AuthorizationCheck](#codersdkauthorizationcheck) | false | | It is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects. |

## codersdk.AuthorizationResponse

Expand Down
9 changes: 2 additions & 7 deletions scripts/apidocgen/markdown-template/main.dot
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,15 @@
return "";
}

const toSnakeCase = str =>
str
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
.map(x => x.toLowerCase())
.join('_');

const words = p.description.split(' ');
if (words.length == 0) {
return "";
}

const countUppercase = words[0].length - words[0].replace(/[A-Z]/g, '').length;
if (countUppercase > 1) {
const displayName = p.displayName.charAt(0).toUpperCase() + p.displayName.replaceAll("_", " ").toLowerCase().slice(1);
let displayName = p.displayName.replaceAll("» **additionalProperties**", "It");
displayName = displayName.charAt(0).toUpperCase() + displayName.replaceAll("_", " ").toLowerCase().slice(1);
return displayName + " " + words.slice(1).join(' ');
}
return p.description;
Expand Down