@@ -57,15 +57,15 @@ async function evaluateFeatureFlag(context, authInfo) {
5757 * wrapper), this wrapper checks whether the authenticated user is a read-only admin.
5858 * If so it:
5959 *
60- * 1. Evaluates the `FT_LLMO-3008 ` LaunchDarkly feature flag (fail-closed).
60+ * 1. Evaluates the `FT_READ_ONLY_ORG ` LaunchDarkly feature flag (fail-closed).
6161 * 2. Resolves the route's action from the routeCapabilities map and blocks
6262 * write operations (or unmapped routes) for RO admins.
6363 * 3. Emits a structured audit log entry for allowed RO admin requests.
6464 *
6565 * Non-RO-admin requests pass through untouched.
6666 *
6767 * @param {Function } fn - The handler to wrap.
68- * @param {{ routeCapabilities? : Object<string, string> } } opts - Map of route
68+ * @param {{ routeCapabilities: Object<string, string> } } opts - Required map of route
6969 * patterns (e.g. 'GET /sites/:siteId') to action strings ('read' | 'write').
7070 * @returns {Function } A wrapped handler.
7171 */
@@ -84,6 +84,7 @@ export function readOnlyAdminWrapper(fn, { routeCapabilities } = {}) {
8484 if ( ! ffEnabled ) {
8585 log . warn ( {
8686 tag : 'ro-admin' ,
87+ email : authInfo . getProfile ?. ( ) ?. email ,
8788 org : authInfo . getTenantIds ?. ( ) [ 0 ] ,
8889 } , 'Feature flag disabled, denying RO admin access' ) ;
8990 return forbidden ( 'Forbidden' ) ;
@@ -99,6 +100,7 @@ export function readOnlyAdminWrapper(fn, { routeCapabilities } = {}) {
99100 if ( action !== 'read' ) {
100101 log . warn ( {
101102 tag : 'ro-admin' ,
103+ email : authInfo . getProfile ?. ( ) ?. email ,
102104 method : context . pathInfo ?. method ,
103105 suffix : context . pathInfo ?. suffix ,
104106 org : authInfo . getTenantIds ?. ( ) [ 0 ] ,
@@ -109,6 +111,7 @@ export function readOnlyAdminWrapper(fn, { routeCapabilities } = {}) {
109111
110112 log . info ( {
111113 tag : 'ro-admin-audit' ,
114+ email : authInfo . getProfile ?. ( ) ?. email ,
112115 method : context . pathInfo ?. method ,
113116 suffix : context . pathInfo ?. suffix ,
114117 org : authInfo . getTenantIds ?. ( ) [ 0 ] ,
0 commit comments