Sitefinity / sitefinity-admin-app-extensions

Sitefinity AdminApp Sample Extensions
19 stars 18 forks source link

How to validate user permissions on custom components, commands, etc.? #287

Open relizondobarrios opened 3 years ago

relizondobarrios commented 3 years ago

We are working with Module Builder and creating a content type called Catalog. For Catalog, we hide the standard "Create" button and instead implement our "Create" button.

Our "Create" button opens a dialog and inserts a catalog item using the Sitefinity web services API. Now, we need to validate the user permissions in this creation process. For example: We only want to allow administrator users to create catalogs.

How can we integrate user permission validations into our custom components, commands, etc.?

Novkirishki commented 3 years ago

Hi @relizondobarrios, to achieve the desired behavior you can do the following:

The client application (AdminApp) has no knowledge of user permissions. This logic takes place on the server.

Hope this helps.