# All channels
Sachin D. Shinde@sachin-shinde
Sharing an @auth directive over multiple servicesMarch 24, 2020 at 7:34am
Hi, I am trying to implement RBAC in my federated Apollo stack. Normally I would use a
(permission = 'module.submodule.action'). However the directives are not shared between the services so now each service would need to implement the same directive. This would not have been a problem when it was a directive like that doesn't use data that is not available inside the federated service. Sadly the needs to look up a user and its roles and (a lot of) permissions from my identity service. I hoped that when I defined the directive in the identity service they would also be available in the other services but that did not work. The system is also quite big so getting the permissions in the context of the gateway and sending it to the services using headers is a no go as they likely could exceed the character limit. I sometimes also just need to lock a attribute and sometimes the entire type
Do you guys know how I would achieve something like that? Perhaps it is possible for me to implement the directive in the gateway and just "type" it in the underlaying services (mimicking the , , , ... of /federation) but I have no idea how I would implement directives in the gateway itself.