PDA

View Full Version : Default navigation bar disable?



gcjm
2016-03-09, 11:30
Is it possible to disable the default navigation bar (+ / delete / ... / undo) ?
Then it's necessary to built an own navigation like in Lianja Webapp Example 2...

Or

could I set different rights to the default navigation bar?
- The normal user should be able (without login) to add new records and to navigate between the recs but cannot delete and edit records.
- The admin needs to login and has full rights after it.

Think from a guestbook...

josipradnik
2016-03-09, 12:10
Hi

You can hide actionbar (that is his name) on page level:
Page attributes: Appearance | Hide actionbar

Here is a picture to remember UI parts:

http://www.lianja.com/community/attachment.php?attachmentid=806&d=1413543003

The second part of the question:

You need to create Roles and define to which App and even to which UI control it is applied.
This way you set if a Role can Create, Read, Update, Delete.

Finally, you assign roles to every user.

yvonne.milne
2016-03-09, 12:20
From v2.1 (http://www.lianja.com/resources/roadmap#lianjacloudserver2_1) you will be able to user Users and Roles in Web Apps so that CRUD (create, read, update, delete) operations are determined by the user's roles.

These are already supported in the desktop client and you can read more about them in the Lianja wiki here (http://www.lianja.com/doc/index.php/Users_and_Roles).

Currently in the Web Client, as Josip says, you have the option to set the Page's 'Hide actionbar' attribute to True.

Regards,

Yvonne

gcjm
2016-03-09, 12:49
Thank you Josip and Yvonne!
ad 1. "Page attributes: Appearance | Hide actionbar" => Ok! Thanks
ad 2. CRUD: It's clear to me too. But: How to create a "normal user" who don't need a login and who can Create and Read only? (naturally Navigate..)

What does mean !dynmanager (the !) in your USERS picture?

josipradnik
2016-03-09, 13:16
Vow, you are a fast reader. I deleted screenshot from my post after viewing Yvonne's answer about roles.

I am backing it here, so others will know what we are talking about:

1259


As you can see, it may be applied to page (pCustomers), or deeper to section (pCustomers.sCustomers), or even to field level (pCustomers.sCustomers.fCustomerID).




What does mean !dynmanager (the !) in your USERS picture?

Dynamic Role Pairs

The other dynamic roles defined above are dynamic role pairs. That is, for each main role, there is a matching role with a ! prefix. In this case, the ! prefixed role will be applied to any user who does not have the main role.
For example, here is the dynhr role:


Role
App
UIcontrol
Create
Read
Update
Delete


dynhr
dynroledemo
pHR
True
True
True
True


and the matching !dynhr role:


Role
App
UIcontrol
Create
Read
Update
Delete


!dynhr
dynroledemo
pHR
False
False
False
False


They both apply to just the pHR Page in the dynroledemo App. Anyone who has the dynhr role, currently just Harry, will have full Create, Read, Update and Delete permissions for the pHR Page. All users without the dynhr role will have the !dynhr role applied when they open the dynroledemo App and will not even be able to see (Read) the pHR Page. This role and the others that follow here have no effect on any App other than the dynroledemo App.

http://www.lianja.com/doc/index.php/Users_and_Roles

gcjm
2016-03-09, 13:43
:) Sorry, I'm not so fast as you may think. And thank you for the Link again (Yvonne already sent before) "Users_and_Roles".

Again, it is not clear to me
how I could create a "default user" who don't need a login (!!!) and who can Create and Read only?

josipradnik
2016-03-09, 14:08
Hi,

Bypassing login screen is accomplished by App settings: General | Enable guest access.

Problem is that you then bypass "users and roles" stuff and you need to program whole logic by yourself.
Without login, forget about users and roles benefits. I think.

HankFay
2016-03-09, 14:28
Good question: if there were a ! role for every role, wouldn't the "guest" user end up with all the !roles? It's worth checking -- let us know how it turns out. <s>

The --customer command line switch could be used for those who need to log in.

Or the --loginapp command line switch could be used for those who don't need to log in.

Both the above apply to desktop apps, of course.

For web apps, the URL for guest access would be, e.g.:

http://localhost:8001/apps/example_webapp4/index.html

And as Yvonne notes, UI Roles etc. will be in 2.1.

Hank

gcjm
2016-03-10, 03:14
Thank you all!
Georg

I think: Because the Actionbar does not consist of single elements (f.e. buttons) with single roles and rights to define, the Actionsbar is not not suitable for my problem, think of a guestbook!

So could a guestbook consist of two separate pages:
1. a page for the admin (having all rights after login)
2. a page for the "guest" user (without login): one section to fill in the data and a "send" button and below a WebView section where all entries are displayed (simple or more sophisticated.

(Is there a tool to generate a (graphical?) code to type in before "send" is pressed?)

yvonne.milne
2016-03-10, 08:48
Hi Georg,

Once you have roles in the Web Client, when a user who does not have the role clicks the delete button on the actionbar, a message will be displayed to say that they cannot delete.

If you don't want them to see buttons that they cannot use, then yes with roles you will be able to set the Read role on individual Pages so that all users will be able to see certain pages and only users with specific roles will be able to see others.

Lianja does not have a built-in captcha control, but if you search online you should be able to find one - maybe css or JavaScript - that you can include. Perhaps other developers have recommendations of ones they have used?

Regards,

Yvonne

gcjm
2016-03-10, 10:30
Thank you, Yvonne!

A last question on "Actionbar":
I'm sure in the meantime :-) I don't need the Actionbar but a Custom Menu like in WebappExample 2.

Can I enable and disable the buttons (like Contact, Filter, Reset etc.) programmatically?

gcjm
2016-03-10, 11:30
Hi Josip, I've got an email


Hi, You build it as you wish
Section Attributes: Menu | Custom menu
Code:...

but I can't find the thread on the WebSite... ok.

I know the method and code. It's from the example.
The question was "How to enable and disable the Menu buttons". Like "fieldXY.enable = false;" ???

yvonne.milne
2016-03-10, 12:08
Hi Georg,

Lianja.getElementByID("page.section").menu is exposed on the Desktop client only (Lianja/VFP), you can't currently modify the Section custom menu options in JavaScript code for Web Apps.

For more on Section Menus see on the Lianja Wiki here (http://www.lianja.com/doc/index.php/Section_Menus).

Regards,

Yvonne

josipradnik
2016-03-11, 03:52
Enabling / disabling custom section menu items is not possible in this concept.
It is intended to use a string written in Section Attributes: Menu | Custom menu , like...:


Contacts,Reset,Filter(All|Sales|Owner|Marketing|Ac counting),Navigate(First|Previous|Next|Last),Repor ts(High Credit Customers|Over Credit Limit|Customer List),Search,Map

...and to deal with actions by code in

Section Attributes: Custom delegates | Custom section menu.

This is quite static. You can only programatically write new string in Custom menu and refresh section.
And need to be sure that you have mentioned all possible cases in your delegate code. But, as Yvonne said, works only in desktop app.

Yes, there is no much developer control. I advice you to send ER (Enhancement Request) for prefixes which will enable/disable items.

Barry mentioned once:

The App Center and the Page Center are .rsp files that generate dynamic HTML5 / JavaScript.
you can customize these with your own background image and branding, and also add the menu bar that you mention by reading the appcenter.rsp source code.
Well, this is not for section, but app level.

In the meanwhile, you can look at some different approaches (Herb is our pioneer).
See his videos with menus: https://www.youtube.com/watch?v=DlEHGGe00VA and https://www.youtube.com/watch?v=PGmVEP_YwrI

Here are some interesting posts:
http://www.lianja.com/community/showthread.php?2676-Menus-and-ShowDialog
http://www.lianja.com/community/showthread.php?2675-Windows-Style-Menus-in-Lianja
http://www.lianja.com/community/showthread.php?1543-Dynamically-change-menu-text
http://www.lianja.com/community/showthread.php?1130-Popup-menu

Josip