Search code examples
dotnetnuke2sxc

2sxc "had an Error Talking with the Server (Status 403)"


I installed a 2sxc version 11.11.3 Inside a fresh dnn 9.3.2.

After this I created a content Module with the simple test view inside. After this I granted this module the edit permission to the Registered Users Group on dnn module Level.

If I log in as a registered user I can see the 2sxc toolbar (blue symbols when hovering the item of the module) of the Module and the items. If I press the edit icon I get the Message "had an Error Talking with the Server (Status 403)".

Has anyone an idea what I am doing wrong?

Thank you very much Robert

Edit1 The browser console shows following content in the ERROR object:

error: "Permission denied. required permissions for this request are not given"
headers: t
lazyInit: ƒ ()
lazyUpdate: null
normalizedNames: Map(0) {}
__proto__: Object
message: "Http failure response for https://.../api/2sxc/cms/edit/load?appId=2: 403 OK"
name: "HttpErrorResponse"
ok: false
status: 403
statusText: "OK"
url: "https://.../api/2sxc/cms/edit/load?appId=2"

Edit2 After this I wanted to explore, if the behavior is 2sxc Content module related or if it is related to all apps (in my understanding the 2sxc Content module is an app too). I installed the "FAQ" app, granted the dnn "Edit" permission to the "Registered users" group and logged in as a registered user and pressed the edit icon on the 2scx toolbar - and had the same behavior like described in the origin post.

But: I got it running for the "FAQ" app, but not for the "Content" app. Here are my steps to get it running for the "FAQ" app:

  • click on "Apps management" (available in the dnn edit action or in the 2sxc toolbar)
  • "Features" - add feature - enable "Permission by Group / Role" - Activate feature
  • "Apps" - "FAQ" (or another except Content)
  • "App" - "App Permissions" (click on the icon) - "create new permission" - Identity=xx (xx=RoleId of the Group in table dbo.Roles) - Grant=Edit (in my case I want that the current registered user is able to edit an item) - Save (Ctrl+S)

After this I was able to edit the item of the "FAQ" module.

The "App Permissions" icon is disabled by default for the "Content" module on App level (and on view and data level too). Does anyone know if this is by design or is there a possibility to activate this option? Otherwise I have to migrate my content views to an app to get the permissions running.

Edit3 I ended up by migrating the content of the "Content" app to a new custom app. The effort is very less and getting the possibility to grant permissions was worth doing it.

In a conclusion I'll answer my question by myself. I suppose that the "Content" app has not the possibility granting the dedicated permissions. But the app itself has the posibility - so it could be a good idea, to create content inside an app.


Solution

  • Just some background: The content-app is meant for simple content and behaves differently from normal apps. Example:

    • when you add a content-app, the dialog asks for you to choose what content-type, and what view
    • when you add an app, the dialog asks you for which app, and then what view

    Basically the content-app has various optimizations to make it lighter and simpler, but we wanted to prevent people from "shooting themselves in the foot" because they will usually start with content, and then make it increasingly complex (never separating different concerns) and end up with a big mess.

    This is why the content-app has some forced limitations (like no app-permissions) to guide people to place more complex functionality in own apps.

    Now note that this doesn't explain your original issue: apparently edit-permissions didn't work as expected. That seems to be a bug, not an intension. If you think that should be followed up, best create an issue on github.