Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to create fully custom Role, User, Event, Resource classes for use with the Security (old) and Scheduler modules

$
0
0

This example demonstrates how to create fully custom classes for use in our Security Module (with the 'old' DevExpress.ExpressApp.Security.SecurityComplex component) and Schedule Module:
    - Activity is an analog of our standard Event class that is used to represent appointments in the Scheduler Control.
    - Employee is an analog of the standard User class, which also supports the IResource interface to use objects of this class as resources in our custom appointment above.
    - Group is an analog of our standard Role class
To enable these two custom security classes in your application set the RoleType and UserType properties for the SecurityComplex component within the Application Designer.

Additionally, the two popular filtering tasks are implemented: filtering appointments by the current logged employee and also filtering resources to show only those owned by the current logged employee.
This functionality is provided by the SchedulerActivityListViewControllerBase class and its descendants as follows:
   a. Administrator account (Sam, to log on, leave the Password field empty) sees all the resources and appointments in the root scheduler view.
   b. Non-Administrator account (John, to log on, leave the Password field empty) sees only his own resources and appointments in the root scheduler view.
   c. Both Administrator and Non-Administrator accounts see their own resources and appointments in the nested scheduler view.
You can use SchedulerActivityListViewControllerBase  and related controllers for study purposes, since they demonstrate the most common filtering scenarios in the scheduler view. If you do not need all this specific functionality, simply remove these controllers and create your own ones (perhaps based on the provided example code) that will do only your specific task. For example, the controllers from this example are not suitable in the nested scheduler view because you miss some part of the default Link/Unlink functionality since the scheduler view is always filtered to show only its own resources and appointments.That may not be desired because you may want to have the capability to link appointments from other resources, but they won't be shown due to the above. Plus, these demo controllers are unnecessary for appointments filtering in the nested scheduler view, because by default, in this view only appointments from the current resources are shown.

Important notes

1. Example implementations are NOT designed for the 'new' security system components and scenarios (e.g., middle-tier application server or SecuredObjectSpaceProvider). To use the SecurityStrategyComplex component, provide fully custom implementations of the user and role classes as per the eXpressApp Framework > Task-Based Help > How to: Implement a Custom Security System User Based on an Existing Business Class article.

2. The Activity (appointment) and Employee (resource) classes' code was once created based on the code of the default Event and Resource classes from our DevExpress.Persistent.BaseImpl library. It may be necessary to update their code based on the source ...\XAF\DevExpress.Persistent\DevExpress.Persistent.BaseImpl\ library sources according to changes made in the latest XAF versions.

Question Comments

Added By: Ad de Rijke at: 5/19/2014 4:52:28 AM    

The Web project does not compile: 'The type or namespace name 'WinWebSolutionAspNetApplication' could not be found (are you missing a using directive or an assembly reference?)'

Added By: Dennis (DevExpress Support) at: 5/20/2014 3:31:16 AM    @Ad: For some reason the WebApplication.cs file was emptied. I have attached a working sample for your reference. I will also update this example as well.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>