[content-manager] types for permissions service (#19015)

This commit is contained in:
Jamie Howard 2023-12-11 10:48:25 +00:00 committed by GitHub
parent 46e6ffbb44
commit 6f2783dadd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,17 @@
import { prop } from 'lodash/fp';
import { contentTypes as contentTypesUtils } from '@strapi/utils';
import { LoadedStrapi as Strapi, Schema } from '@strapi/types';
import { getService } from '../utils';
export default ({ strapi }: any) => ({
canConfigureContentType({ userAbility, contentType }: any) {
export default ({ strapi }: { strapi: Strapi }) => ({
canConfigureContentType({
userAbility,
contentType,
}: {
userAbility: any;
contentType: Schema.ContentType;
}) {
const action = contentTypesUtils.isSingleType(contentType)
? 'plugin::content-manager.single-types.configure-view'
: 'plugin::content-manager.collection-types.configure-view';