> For the complete documentation index, see [llms.txt](https://divine.qibergames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://divine.qibergames.com/advanced-usage/images-and-media/implementation-permissions.md).

# Implementation permissions

You can create a rule for the service interface, that specifies, which classes may implement the interface.

<figure><img src="https://3376145113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F40YFNvjPqSybFHd4PSEP%2Fuploads%2FrJfsQK6dsgEgiyRkrElI%2Fimage.png?alt=media&amp;token=51458bfb-320f-4960-b345-3fb22aaf1daa" alt=""><figcaption></figcaption></figure>

```java
@Service(permits = { MongoUserService.class, MySQLUserService.class })
interface UserService {
}

@Service
class MongoUserService implements UserService {
}

@Service
class MySQLUserService implements UserService {
}

@Service
class PostgresUserService implements UserService {
}

void initUserService() {
    Container.implement(UserService.class, MongoUserService.class);
    Container.implement(UserService.class, MySQLUSerService.class);
    // both should work fine
    
    Container.implement(UserService.class, PostgresUserService.class); 
    // will throw an `InvalidServiceAccessException`
}
```
