如何更改Salesforce自定义Visualforce页面上用户的读取访问
问题是关于Salesforce中的自定义Visualforce页面。该页面是为获得联系人,机会,贷款创建的,所有贷款都位于名为“ Manage Portal Access”的帐户上的单个动态链接,该帐户属于“客户门户网站访问”选项卡中的详细信息和“帐户”选项卡下的相关列表。页面为为管理客户帐户,联系人和机会关系而创建。该页面包含电子邮件,角色,最后登录和一个切换按钮作为“启用”。启用此切换按钮时,这些用户可以访问此门户关系。它还具有相应的Apex类。
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.
“作为用户,我只想阅读对门户标签的访问。我希望能够在棕褐色上查看所有信息,然后单击任何动态链接,但无法切换门户网站启用或非输入启用任何联系人。 应最少读取以下两个访问权限的访问权限
- Salesforce用户
- 所有
- 。自定义选项,例如通过(布局,FIELS FLS,验证规则)提供对salesforce中对象的访问?
或
- 这只能通过Visual Force页面上的代码和各自的Apex类实现,如果是这样,我该怎么做,无论是提供任何某些命令或方法可以提供访问还是通过控制器类提供?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以在VisualForce中引用“正常”对象权限(创建/读取/更新/删除)和字段级别安全性(读取/更新)。像这样的事情可能对您来说足够:
检查 DefictefieldResult 在Apex参考中。 VF开发人员指南中也提到了一些内容,但它有点隐藏,没有那么详细: https://developer.salesforce.com/docs/atlas.en-us.234.0.pages.meta/pages/pages/pages_variables_global_obignttype.htme.htm
如果您需要更多的控制字段是否可编辑 - 也许查看。它们是您自己的复选框,您将添加到配置文件/权限集中,您可以在纯VF中检查它们也不需要顶点。
所以...你决定。如果该页面的大部分都应该是相同的,则“仅”有关启用/禁用的按钮(或者甚至根本没有渲染) - 最好将条件放入按钮中。如果听起来您需要2种不同的布局 - 拥有2个大块代码,一个或另一个渲染的代码可能会更干净,以维护和测试。
PS请记住,好的测试器可以使用浏览器的开发人员工具激活按钮。您应该制作类似的“字段可访问 /是自定义权限分配的“在按钮单击”上运行的Apex中。
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:
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.