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 ## Overview
15
16 The `Role` method on a `Site` object returns the `Role` object for the given site, derived from the role definition in your project configuration.
17
18 ## Methods
19
20 Use these methods on the `Role` object.
21
22 `IsDefault`
23 : (`bool`) Reports whether this is the [default role](g).
24
25 ```go-html-template
26 {{ .Site.Role.IsDefault }} → true
27 ```
28
29 `Name`
30 : (`string`) Returns the role name. This is the lowercased key from your project configuration.
31
32 ```go-html-template
33 {{ .Site.Role.Name }} → guest
34 ```