Currently the list component just shows all items (links) but I'm trying to find a way to hide a certain links, based on the logged in user role.
It seems that [Plugin:Equals] and [Plugin:NotEquals] tags allow us to conditionally show/hide the links, so I think this is probably the approach can try. But when it comes to getting the user access role/group info, I feel a bit stuck.
For now, I am only able to find the following fields that are available for use:
${wp.user.cn}
${wp.user.sn}
${wp.user.uid}
${wp.user.preferredLanguage}
And the online document doesn't say much either. https://www.ibm.com/support/knowledgecenter/SSYJ99_8.5.0/dev-theme/themeopt_el_bean_user.html
So is it possible to get the assigned user access group via wp.user? Or perhaps there are other ways to show/hide the links in the list component?
Not via wp.user you would need to use the access control model, but would be better using the attribute based security
WCM Security will hide any links the current user doesn't have access to - be it a Site Area, Content Item / Link. Check your security on the objects which shouldn't be showing. You'll most likely find you haven't restricted access.
Related
The question is about the custom visualforce page in Salesforce. The page is created for getting contacts, opportunity, loans all are at a single dynamic link on the account named "Manage portal Access" Which comes under "Customer Portal Access" Tab like details and related list under "Account" Tab.The page was created to Manage the customer account, contacts and opportunities relationship. The page contains Email, Role, Last Login and a Toggle button as "Enabled".When this toggle button is enabled, those users have access to this portal relationship. It has respective apex class also.
The task here is, the toggle button can be enabled/disabled by some users, this want to be changed here by providing Read only access and assign two permission sets for edit access on this portal enable/disable.
" As a user I want Read Only Access to the portal tab. I want to be able to view all information on the tan and click through any dynamic links, but not be able to toggle the portal enable or un-portal enable any contacts. All Salesforce users should have a minimum of read only access to the Customer Portal Access Tab. The two permission below currently and should continue to provide edit access to the customer portal access section.
Create Customer Portal User
Document Manage Portal Admin "
Whether there is any customization option like providing access to objects in Salesforce through (Layouts, Fields FLS, Validation Rule)?
Or
-This can be achieved only through code on Visual force page and it's respective apex class, if this is the case how can I do it, whether there is any certain command or method for providing access or through controller class?
The "normal" object permissions (Create/Read/Update/Delete) and field level security (Read/Update) can be referenced in Visualforce. Something like this might be enough for you:
<apex:commandButton disabled="{!$ObjectType.Contact.fields.Role__c.updateable}">
Check the DescribeFieldResult in Apex reference. There's also something mentioned in VF developer guide but it's bit hidden and not as detailed: https://developer.salesforce.com/docs/atlas.en-us.234.0.pages.meta/pages/pages_variables_global_objecttype.htm
If you need more control than just whether field is editable or not - maybe look into Custom Permissions. They're your own checkboxes you add to Profile/Permission Set and you can check them in pure VF too, no apex required.
So... you decide. If most of the page is supposed to be identical, "just" about the button being enabled/disabled (or maybe even not rendered at all) - it's best to put the condition in the button. If it sounds like you need 2 different layouts - having 2 big blocks of code and one or another rendered might be cleaner to maintain and test.
P.S. Remember that good tester can activate the button using browser's developer tools. You should make similar "is field accessible / is custom permission assigned" check in Apex that runs on button click.
I am very new to Salesforce, so apologies if my use of terms is not correct.
I am using Lightning Knowledge
I have enable and setup Knowledge Base and added FAQ articles and have added Question and Answerr fields to those articles.
I have setup the field visibilty so they are visible to all user including "Read Only" users (I could not find anything specific for Guests, should there be?)
So as far as I can tell the field permissions on the Question and Answer fields is correct.
I create articles and enter my values for my "Question and Answer fields" but when I go to my public site to view the FAQ, I only see the content of the Title and URL Name fields. I do not see my Question and Answer Fields.
If I login and view the articles via the public site, I do see the Question and Answer values.
I would very much appricaite it if anyone could point me in the right direction for trying to figure this out. I have googled but cannot seem to find anything that talks about guest users and field visibilty that has helped me.
Many Thanks
Derek
Yes, guest user is still an user. There's hidden user account (which acts as "created by" when you make new Case for example) and Profile which you might have to edit. It doesn't show up on normal list of profiles (but for example the Id can be queried and once you know Id you could construct the url yourself).
If you're using an Experience Cloud (aka Community) go to your site's Builder and the links will be at the bottom.
If you're using Sites - it should be in Site's config.
I had the exact same issue, but did see the solution documented in the previous comments.
In your community navigate to Settings
Select General
Click link under Guest User Profile
Scroll down to Field-Level Security
Click View for Knowledge
Click Edit
Check the Read Access box for the fields which are not displaying
Click Save
I started with admin-on-rest recently and I love what it brings. However, I am stuck on 2 issues and I was hoping to get some help:
Question 1
I created a custom theme with custom color pallette etcetera. How can I reduce the spacing around buttons? You can see it on the demo here: https://marmelab.com/admin-on-rest-demo/#/customers/121, the save button has an indent of maybe 20-30 pixels. Can I remove this and align the button with the input fields, title, etcetera?
Question 2
What is the best approach for creating an /#/user/details/ view for example, where users can edit their own account details, re-using the EDIT component? I have now added this resource:
<Resource name="user/details" edit={EditDetails} />
I can edit the account by going to /#/user/details/ID (replacing ID with the actual user ID). But I don't want to expose the ID. Better yet, the SPA doesn't need to know about the ID at all, because the API can understand a PUT request to /user/details/ as a request to update the current user details. So I don't actually need the SPA to send or need this ID. Any ideas on this?
Question 1: https://marmelab.com/admin-on-rest/Theming.html#overriding-a-component-style
Customizing the Toolbar which contain the button will require a bit a of work in versions 1.*.*. You'll have to create a custom Toolbar using the original as a starting point (https://github.com/marmelab/admin-on-rest/blob/master/src/mui/form/Toolbar.js) and use it as the toolbar prop for your form (https://marmelab.com/admin-on-rest/CreateEdit.html#toolbar). This will be a lot easier in v2.
Question 2: this can be achieved using a custom restClient. In a nutshell, intercept calls which target the user resource and build the url yourself, not forgetting to handle the response.
However, for such a thing, I would advise against using the admin-on-rest mechanisms as it seems users are not really a resource but an application concept. As such you might want to handle this in a custom page with fetch by yourself.
I'm looking to edit Drupal's admin pages.
Some of the things I'm trying to achieve:
Remove is the the filter setting on the Content page/node/view. In other words, if I go to to the Content page and I filter by a certain type of node, then I leave that page, then come back, the filter setting is saved, I'd like it to reset each time I visit the Content page.
I would like to modify some of links associated with these pages, as an example on that Same Content page, the titles of the pages are linked to their 'front-end' views, I'd rather have them link to their 'edit' screens.
While I have been successful in modifying the front-end theme of Drupal, by editing the actual php files. I can't find the the same php files for the Admin theme. In our case we are using Seven (7.21). I've read something about views, and thought maybe the entire Admin theme is built as views, aka there no php files involved like the front-end theme has, but under the Views section I did not find any either. I'm still pretty new at this and coming from the Wordpress world, this is a Drupal is a lot different.
The logic for that section of the admin area is at (from the public root):
/modules/node
Specifically "node.admin.inc"
That being said, I don't recommend editing core scripts, as they will be overwritten when you update the core.
You could explore making your own module to supplement that page, or your own view or explore some pre-made modules, such as "Admin Views"
Find de view displayed and go to its configuration :
1 - Edit configuration view like suggested here : https://drupal.stackexchange.com/questions/44440/how-to-remember-exposed-filter-choices
2 - Rewrite output views to rewrite link : field https://www.drupal.org/node/1578524
Another option is to create and use your own dashboard/views to achive like you want http://definitivedrupal.org/suggestions/creating-custom-administrator-view-content
also you can see contrib module : https://www.drupal.org/project/admin_views
You don't have to use that default content overview page at all. Make your own instead:
Make a page view (you have to install views module if you already did not: https://www.drupal.org/project/views) and use table layout. Make sure that page paths starts with "admin" so it will use admin theme. Also pay attention about permissions, so only specific set of users (admins) can use it.
For that view you can freely select what columns you what to show. You can also allow ordering by any column and action if you click on some field.
Use exposed filters to add filtering form, again add any filters you need. You can even set the form to use AJAX, to do auto-submit when some filter field is changed, include reset button and more. Also for every exposed filed you can select (at fields settings) should it remember it's value or not.
At end, edit admin menu and add your new page to it so it will look and act as default one but will offer much more functionality. You can even totally remove default one from the admin menu.
Views module is very powerful, not only for front-end but also for back-end content handling.
I'm trying to find the best way to create a user friendly admin menu for my client on the site I am building. So far I have been able to set access rights to the various types of content which I would like the client to edit, however this has some drawbacks in that I can't set provide access to individual blocks and the content overview page is wayy too confusing for the client.
Instead I would like to provide a structure like the following:
Admin Menu
Services
Manage
Edit page header block
Developments
Manage
Edit page header block
Private commissions
Manage
Edit page header block
Each Manage option would take the client to a page like the Content overview page in the standard admin but it would automatically filter the results to include only the relevant content type e.g. the Manage option for developments page would show the user a list of the current developments and an option to Add a new one.
The Edit page header block options would take the user to the edit page for the relevant page header block.
Is this possible and if so how?
Any advice would be really appreciated.
Thanks
Have you checked out the Quickbar module?
Your description might be a little hard to understand what you're trying to accomplish, but if I get it right, you're trying to do a very custom "view" of the content pages. If you have to code it, then it's gonna take a long time.