Page 1 of 1

Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by Annika >> Mon, 22 Sep 2003 2:25:03 GMT

I am currently workin on a bookshop application and was wondering sincee i have an employee log in and an administrator log in is it possible to restrict the viewin of some forms to the basic employee or do i need to have 2 different schemas fotr both.

If it is possible to have just one schema how to i restrict general employees from viewin some forms e.g payroll

Re: Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by Patwos >> Mon, 22 Sep 2003 4:40:01 GMT

Absolutely you can do this from a single App/View schema.

If this is a simple case where all Admin users can see the same functions, then you could use the securityLevelVisible or securityLevelEnabled features in painter to hide/disable the menus and buttons that open these forms from other than admin users.

If it is not as simple as this, then you'll need to setup your own permissions/security structure and make appropriate functions available or not based on the current user login permissions.

Hope that helps,
Pat.

Re: Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by allistar >> Mon, 22 Sep 2003 8:43:08 GMT

In addition to this you could have an app.myUser reference which points to the User object for the user that logged in. Then on forms you could do something like this:

tbSomeTextBox.visible := app.muUser.isAdministrator;

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

Re: Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by Annika >> Mon, 22 Sep 2003 11:02:49 GMT

Thanks a heap allistar and Patwos wouls any of u have an example of a jade application where this has been done or an example of a point of sale (purchasing) application, a stock control/stock inventory/stock orderin application, Staffing and payroll application or an online purchases application.

Just wanna know what they ought 2 b like as i believe u two are advanced users of jade and would b in a good position to give me tips.

Thanks a heap,

Annika

Re: Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by allistar >> Mon, 22 Sep 2003 21:03:57 GMT
Thanks a heap allistar and Patwos wouls any of u have an example of a jade application where this has been done or an example of a point of sale (purchasing) application, a stock control/stock inventory/stock orderin application, Staffing and payroll application or an online purchases application.

I don't have a free example of those types of applications, sorry.
Just wanna know what they ought 2 b like as i believe u two are advanced users of jade and would b in a good position to give me tips.

Thanks a heap,

If you have any specific questions this is the place to ask.
Annika

Allistar. ------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

Re: Restricting Views

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by Sam Pride >> Tue, 30 Sep 2003 11:52:19 GMT

Annika,

Your problem sounds VERY familiar. In fact, it sounds EXACTLY like an assignment at Edith Cowan University, specifically CSI2441 Assignment 2. I know ECU, along with other universities; have strict guidelines on cheating and collusion as well as plagiarism.

Just a word of caution, your tutor/lecturer most probably monitors these newsgroups and will be able to tell the difference between guru/newbie coding.

That being said, if this is not for an assignment, I apologise. To implement a crude level of security, create a reference to a 'user' (or equivalent) class in your app object. When logging on, set this reference to the current user. On each form you want to secure, overload the form's load() method. You may want to either check a field against some pre-defined/dynamic value or perform some form of rtti(run-time type Identification), if your administrator etc is a subclass of user. From here, you can either continue loading the form, or abort loading the form and take the appropriate actions.

You'll also find that most people who have POS systems implemented in JADE will hold it closely to their chest. They are good money-makers and I'm sure there are heaps out there.

--Sam Pride
s.pride[AT]ii[DOT]net