Debian Codegraph @

docs/content/en/methods/site/Role.md

raw
1 ---
2 title: Role
3 description: Returns the Role object for the given site.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 returnType: roles.Role
9 signatures: [SITE.Role]
10 ---
11
12 {{< new-in 0.153.0 />}}
13
14 The `Role` method on a `Site` object returns the `Role` object for the given site, derived from the role definition in your project configuration.
15
16 ## Methods
17
18 ### IsDefault
19
20 (`bool`) Reports whether this is the [default role](g).
21
22 ```go-html-template
23 {{ .Site.Role.IsDefault }} → true
24 ```
25
26 ### Name
27
28 (`string`) Returns the role name. This is the lowercased key from your project configuration.
29
30 ```go-html-template
31 {{ .Site.Role.Name }} → guest
32 ```