My proposal of extension : “uam-visitor” can be a role : an application
-
Hi,
Note that my proposal of the definition of a “uam-visitor” as known role with associated capabilities, given to user = 0 (WP visitor) by UAM, can be find on github The visitor seen as a role by UAM.
I give here my last comment which explain a typical extension of features allowed by the concept and his implementation.
Copy of the text :
Even though there is no particular reaction to my last answers (even they are long), here today I give an example of application:
with my configuration, UAM locks perfectly the read capability of a visitor for pages or article which are not completely ready to be visible for any visitor, but this can not be sufficient.If I use for example a W4PostList to display a list of excerpt of the articles, I can see that though the “view of full post” (accessible by “read more…”) is locked, the excerpt is nevertheless displayed. Then the visitor can get long list of articles which are quite drafts and not readable… what a bad configuration (“read more” leads to the page “no access” if defined, else 404 ).
The true need is to have three basic possible configurations:
– Post is visible by visitor and obviously the excerpt
– Post is not visible because his access is reserved but excerpt is visible by visitor (current case of standard articles for which full display is reserved to free subscribers or paying subscription subscribers for many publications)
– Post is not visible and his excerpt no more (full hidden articles) with two main reasons
– Confidential access
– the Posts are waiting for last author reading and correction before being “fully published”There is no way top manage this without the “uam-visitor” concept.
It is easy to add the capability “read excerpt” and associate it to uam-visitor and check:
if (current_user_can('read-post_excerpts')) { ... }
In a same way you can add special capabilities which check can tell if “uam-visitor” as no access to full article if he has not subscribed or logged-in, this more efficient and accurate than the simple “post-read”.
Best regards
Trebly
- The topic ‘My proposal of extension : “uam-visitor” can be a role : an application’ is closed to new replies.