iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
This works.......RequiresRole="{Binding RequiredRoles}" so I can retieve roles from user table and amend dynamically.
However this...does not appear to work...
RequiresAuthentication="{Binding RequiresAuthenticationProperty}"
Can you please advise.
I have discussed this topic with the ClientUI development team and find that the RequiresRole and RequiresAuthentication property of UXPage is not designed to be bind-able due to security reason.
Those properties need to be declared explicitly. On Silverlight, the data context will be resolved after passing through several phases. In an application which requires certain pages to authenticate against current user, it is expected to get the information regarding RequiresRole and RequiresAuthentication; then redirect the user to the login page in the early phase. If authentication process fail, the target page will not be rendered; objects inside the page will not be created; and related data (such as products data or sales data) will not be processed. User will be redirected to the login page.
However, it might be late to obtain the information regarding RequiresRole and RequiresAuthentication if we use binding. Related data probably has been processed or objects have been created. As an alternative, you can try to use traditional approach to set those properties in code-behind of the page.
Hope this helps.
Deeply apologize for the delay in sending this.
I started my investigation by adding a Boolean property in view model.
private bool _requiresAuth; public bool RequiresAuth { get { return _requiresAuth; } set { if (_requiresAuth != value) { _requiresAuth = value; OnPropertyChanged("RequiresAuth"); } } }
Then I bind the RequiresAuthentication of UXPage to RequiresAuth in view model.
<Intersoft:UXPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ... RequiresAuthentication="{Binding RequiresAuth}" ...>
Last, I added a breakpoint in the getter of RequiresAuth, in order to check whether this breakpoint will be invoked during binding operation or not.
As shown in the above screenshot, the binding operation works.
Yes I can verify that the binding operation appears to work but when RequiresAuth is set to true the page still loads under guest user!!
public SearchViewModel() { RequiresAuth = true; RequiredRoles = Utils.GetSetting("SearchRequiredRoles"); }
The RequiredRoles = Utils.GetSetting("SearchRequiredRoles") does however work.
I await your reply, thanks
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname