mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	Environment agnostic for users-permissions configs
This commit is contained in:
		
							parent
							
								
									520c0bfcc8
								
							
						
					
					
						commit
						957e7a08cb
					
				| @ -29,7 +29,7 @@ module.exports = async cb => { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   const pluginStore = strapi.store({ |   const pluginStore = strapi.store({ | ||||||
|     environment: strapi.config.environment, |     environment: '', | ||||||
|     type: 'plugin', |     type: 'plugin', | ||||||
|     name: 'users-permissions' |     name: 'users-permissions' | ||||||
|   }); |   }); | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ module.exports = { | |||||||
|     const params = ctx.request.body; |     const params = ctx.request.body; | ||||||
| 
 | 
 | ||||||
|     const store = await strapi.store({ |     const store = await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions' |       name: 'users-permissions' | ||||||
|     }); |     }); | ||||||
| @ -128,6 +129,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   connect: async (ctx, next) => { |   connect: async (ctx, next) => { | ||||||
|     const grantConfig = await strapi.store({ |     const grantConfig = await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'grant' |       key: 'grant' | ||||||
| @ -204,6 +206,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   register: async (ctx) => { |   register: async (ctx) => { | ||||||
|     if (!(await strapi.store({ |     if (!(await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'advanced' |       key: 'advanced' | ||||||
|  | |||||||
| @ -71,6 +71,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   create: async (ctx) => { |   create: async (ctx) => { | ||||||
|     if ((await strapi.store({ |     if ((await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'advanced' |       key: 'advanced' | ||||||
| @ -101,6 +102,7 @@ module.exports = { | |||||||
|   update: async (ctx, next) => { |   update: async (ctx, next) => { | ||||||
|     try { |     try { | ||||||
|       const advancedConfigs = await strapi.store({ |       const advancedConfigs = await strapi.store({ | ||||||
|  |         environment: '', | ||||||
|         type: 'plugin', |         type: 'plugin', | ||||||
|         name: 'users-permissions', |         name: 'users-permissions', | ||||||
|         key: 'advanced' |         key: 'advanced' | ||||||
|  | |||||||
| @ -172,6 +172,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   getEmailTemplate: async (ctx) => { |   getEmailTemplate: async (ctx) => { | ||||||
|     ctx.send(await strapi.store({ |     ctx.send(await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'email' |       key: 'email' | ||||||
| @ -184,6 +185,7 @@ module.exports = { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     await strapi.store({ |     await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'email' |       key: 'email' | ||||||
| @ -194,6 +196,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   getAdvancedSettings: async (ctx) => { |   getAdvancedSettings: async (ctx) => { | ||||||
|     ctx.send(await strapi.store({ |     ctx.send(await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'advanced' |       key: 'advanced' | ||||||
| @ -206,6 +209,7 @@ module.exports = { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     await strapi.store({ |     await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'advanced' |       key: 'advanced' | ||||||
| @ -216,6 +220,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|   getProviders: async (ctx) => { |   getProviders: async (ctx) => { | ||||||
|     ctx.send(await strapi.store({ |     ctx.send(await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'grant' |       key: 'grant' | ||||||
| @ -228,6 +233,7 @@ module.exports = { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     await strapi.store({ |     await strapi.store({ | ||||||
|  |       environment: '', | ||||||
|       type: 'plugin', |       type: 'plugin', | ||||||
|       name: 'users-permissions', |       name: 'users-permissions', | ||||||
|       key: 'grant' |       key: 'grant' | ||||||
|  | |||||||
| @ -50,6 +50,7 @@ exports.connect = (provider, query) => { | |||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         const advanced = await strapi.store({ |         const advanced = await strapi.store({ | ||||||
|  |           environment: '', | ||||||
|           type: 'plugin', |           type: 'plugin', | ||||||
|           name: 'users-permissions', |           name: 'users-permissions', | ||||||
|           key: 'advanced' |           key: 'advanced' | ||||||
| @ -97,6 +98,7 @@ const getProfile = async (provider, query, callback) => { | |||||||
|   const access_token = query.access_token || query.code || query.oauth_token; |   const access_token = query.access_token || query.code || query.oauth_token; | ||||||
| 
 | 
 | ||||||
|   const grant = await strapi.store({ |   const grant = await strapi.store({ | ||||||
|  |     environment: '', | ||||||
|     type: 'plugin', |     type: 'plugin', | ||||||
|     name: 'users-permissions', |     name: 'users-permissions', | ||||||
|     key: 'grant' |     key: 'grant' | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jim Laurie
						Jim Laurie