---
title: "@WithPerms"
---

Sets a permission requirement for a setting or class. All configs have a default permission level (2+ normally), this modifies the perms of individual settings or the whole config.

<CodeTabs>

```java !!tabs Java
// changing the permission levels of an entire config
public class MyConfig extends Config {
    //constructor goes here

    @Override
    public int defaultPermLevel() {
        return 4; // default is 2, this sets the default perm level to 4 (owner). WithPerms on the class could also be used.
    }

    @WithPerms(opLevel = 2) // this field is ok to be perm level 2 still, specially set it
    public int mySpecialField = 2;
}
```

```kotlin !!tabs Kotlin
// changing the permission levels of an entire config
class MyConfig: Config(Identifier.of("my_id")) {
    
    override fun defaultPermLevel(): Int {
        return 4 // default is 2, this sets the default perm level to 4 (owner). WithPerms on the class could also be used.
    }

    @WithPerms(2) // this field is ok to be perm level 2 still, specially set it
    var mySpecialField = 2
}
```

</CodeTabs>

<Callout>
See the documentation page <a target="_blank" rel="noopener" href="https://fzzyhmstrs.github.io/fconfig/-fzzy%20-config/me.fzzyhmstrs.fzzy_config.annotations/-with-perms/index.html">here 🗗</a>
</Callout>