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

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.

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.

Related

Salesforce: Visualforce pages not working anymore because of certificate error

I have a dev box running with a namespace and just added a demo visualforce page named "test" and just clicked on "Preview". It is ending up with a certificate error on my browser.
The URL salesforce tries to open is https://myinstance-dev-dev--mynamespace.visualforce.com/apex/test
The certificate being provided by this domain is for "viv1.force.com". That is why my browser is blocking it.
Any idea why this is happening? My visualforce pages were working on the dev box, but now suddenly end up with this error.
Strange solution. Had to check "Critical updates" on setup, and DEACTIVATED the setting "Stabilize URLs for Visualforce, Experience Builder, Site.com Studio, and Content Files". Now it is working again.
I assume for some reason this stabilization missed to change the used certificate behind visualforce pages. Deactivating above option fixed it.

CMS user cannot see "add child page" button

I am trying to use Wagtail within a pre-existing Django project. I have installed the CMS, and it seems to be working well within the existing Django admin - I can authenticate using one of Django admin's users and see the CMS UI, all good.
But: No matter what I try, as an admin user, I cannot see the "Add Child Page" button at the URL of the page e.g /cms/pages/3/. The "Add Child Page" lozenge icon does not show. This is a bit of a pain, because all tutorials and examples assume that this icon is already showing!
The user I am logged-in as is set as "is_superuser" = 't' in auth_user, and one of the two groups the user is in, has been granted ALL wagtail permissions within Django admin (I was desperate!), but still no dice. I've also tried giving ALL perms to other (non-admin) users, and logging-in as them, but still cannot see the button.
I have created a basic HomePage that subclasses Page and I still see no way to create one. delving deeper, I see that one of the user's groups (auth_group.id=1) has the "add" permission in "wagtailcore_grouppagepermission" for the page I am viewing in the CMS which appears correct.
I am new to Python/Django, so I may have missed something obvious!
Django 2.2
Wagtail 2.8.1
CentOS
Python 3.6
(Docker multi-service setup through docker-compose using CentOS)
[UPDATE]
I can see that the following line is failing the test for specific_class being anything other than None. If I hack the line to return True, I see the button in the CMS UI:
./core/models.py:
def can_add_subpage(self):
...
if specific_class is None or not specific_class.creatable_subpage_models():
print('##', specific_class) # None
return False
...
Why would specific_class be None? What exactly is specific_class?
Take a look at the subpage_types declaration: https://docs.wagtail.io/en/latest/reference/pages/model_reference.html?highlight=parent_page#wagtail.core.models.Page.subpage_types
Also see parent_page_types below that.

Error on clicking the LinkedIn Share Button on IE/Edge

I am using the below Share Plugin of LinkedIn in my ReactJS app:
<script src="https://platform.linkedin.com/in.js" type="text/javascript">lang: en_US</script>
<script type="IN/Share" data-url="https://www.linkedin.com"></script>
From LinkedIn Docs: https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin
It is working completely fine on Chrome/Firefox/Safari. But, on clicking the LinkedIn Share button (generated by the above scripts), the LinkedIn Share Popup appears and I get an error in my app console which says:
[object Error]: {description: "[Messenger] Required property 'target'
was not provided", message: "[Messenger] Required property 'target'
was not provided", nr#seenError: true, stack: "Error: [Messenger]
Required property 'target' was not provided at Anonymous function
(https://platform.linkedin.com/xdoor/scripts/in.js:7:55143) at
Array.prototype.forEach (native code) at t
(https://platform.linkedin.com/xdoor/scripts/in.js:7:54936) at e
(https://platform.linkedin.com/xdoor/scripts/in.js:7:56462) at e
(https://platform.linkedin.com/xdoor/scripts/in.js:7:34661) at value
(https://platform.linkedin.com/xdoor/scripts/in.js:18:23834) at s
(https://platform.linkedin.com/xdoor/scripts/in.js:18:38221) at
nrWrapper
([MY_SITE_LINK_ADDRESS]:9:16587)"}
Note: I hid the [MY_SITE_LINK_ADDRESS].
The problem here seems to be that you're relying on the plugin's JS, CSS, and HTML to handle every browser. Take a look: Here's someone else posting in 2018 having the same exact problem, Issue on IE with LinkedIn Share plugin. And, officially from LinkedIn, if you want this plugin to work, you need to ask your users to do this:
Open Internet Explorer.
Click Tools and select Compatibility View Settings.
Uncheck the box next to "Display all websites in compatibility view".
Click Close.
Is it reasonable to ask your users to reconfigure their browser just to be able to click one, single button on your website? Answer: No.
You don't need to rely on the LinkedIn Share Plugin. All you really ought to need is...
https://www.linkedin.com/sharing/share-offsite/?url={url}
Then making sure it works cross-browser is in your hands.
Source: Microsoft LinkedIn Share URL Documentation.
Sure, everyone says: Don't Reinvent the Wheel! I totally agree! But when you find a car that has square, cubic wheels, then maybe you want to reconsider!
If you are interested in a regularly maintained GitHub project that keeps track of this so you don't have to, check it out! Social Share URLs

Wagtail Admin UI: create HomePage without a Site leads to AttributeError crash

I'm new to Wagtail, and I'm exploring the Bakery demo [that is a great demo, by the way!]. I can produce an AttributeError, 'NoneType' has no attribute 'startswith'".
The problem is that the Preview code in the Admin UI assumes that there is a site for every Page. But in my case there is no site yet.
I got to this point by not paying enough attention to the warnings in the Admin UI. But still, a little defensive programming in the Wagtail admin code will protect against this error.
Steps to reproduce:
Get the Bakery demo up and running.
Wonder about creating my own site, as a sibling of the Bakery site. Note the absence of a 'Sites' entry in the Admin UI sidebar, and decide to create a new HomePage thing via Pages -> Add child page (to Root) -> select HomePage as the type of the new child of Root.
Read this warning, but pay no attention: "These is no site set up for this location. Pages created here will not accessible at any URL until a site is associated with this location. Create a site now"
Create a new HomePage thing.
Click "Preview".
Uh-oh.
The problem is that the Preview code in the Admin UI assumes that there is a site. But in my case there is no site yet.
It seems to me that the code that does the Preview operation can check in advance for an associated Site. Or perhaps the code can catch the AttributeError and compose an error response of its own.
Moved to github, as suggested by gasman. I apologize - I misread the wagtail.io website about where to get support.

How to change the "Terms of Use" and "Privacy Statement" in DotNetNuke

How we can change text and wording of "Terms of Use" and "Privacy Statement" pages in Dot Net Nuke from admin?
Those texts are part of the resources files.
Go to menu "Admin > Languages" and click for edit its content for the site or the host.
Keep on the edition of the "GlobalResources" file.
Search for "MESSAGE_PORTAL_PRIVACY.Text" and "MESSAGE_PORTAL_TERMS.Text" and modify them.
If you modify the system version, a future upgrade of your DNN installation could overwrite your customization.
Host mode will impact all websites on the instance.
Site mode will impact only the current website.
I know this is old, but it might still help someone:
Tested with DNN 08.00.04 there are different methods to get a custom terms page without editing the language files (which feels a bit cumbersome)
To have your own /terms page you just create named "terms" in the navigation root.
DNN will show up your newly created page if you browse yoursite.com/terms
You can also redirect to another page from there (create a "link" page instead of "content" page, this in case you want to call your page AGB and have this in the url (yoursite.com/agb)
If you have https://dnnurlmanagement.codeplex.com/ installed you can simplifiy the steps above with just adding a "custom page URL" 301 redirect rule with "/terms" to any page you want to show up as /terms.
Go to site admin section here Admin -> Language -> edit host -> find your required field "Terms of use" and "Privacy". you can change here or edit it.

Resources