Jump to content


Photo

Clone UniMainMenu


  • Please log in to reply
7 replies to this topic

#1 nannoc

nannoc

    Newbie

  • uniGUI Subscriber
  • Pip
  • 9 posts

Posted 27 March 2018 - 09:06 PM

Could anyone please assist me in cloning a UniMainMenu.

I want to clone my MainMenu to use it in a setup procedure to give/deny users of my app access to menu functions. The cloned menu will have check options for each menu item that I will check/uncheck and store in database.


Sent from my iPhone using Tapatalk
  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 28 March 2018 - 04:19 AM

Hi,

 

Please explain again what you wanted


  • 0

#3 nannoc

nannoc

    Newbie

  • uniGUI Subscriber
  • Pip
  • 9 posts

Posted 28 March 2018 - 07:02 AM

Hi,

Please explain again what you wanted


Hi, thank you for responding.

As part of granting user access to my app, I want to grant/deny access to certain menu items. The way I want to do this, is to clone (copy) the current mainmenu into a mainmenu component that I can use in my user setup dialog. This new mainmenu component will have an exact copy of my mainmenu I use in my app and each item will be checkable. In my setup, I will then check each item the specific user will have access to. This information will then be stored for each user and applied to the app’s mainmenu when the user logs in.

If you have a better suggestion, I would appreciate it if you could share.

Thank you
Donald


Sent from my iPhone using Tapatalk
  • 0

#4 mierlp

mierlp

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 289 posts
  • LocationWEERT, Netherlands

Posted 28 March 2018 - 09:42 AM

Create a table with you're users and all the menu items or options in you program.
Every menu item or button or option is a field in this table.

This field can be set true/false. After login you do something like :

 

MainMenu.MenuBank.Enabled := datamodule.table.fieldbyname('Bank').value


  • 0

Event Management Software | Wristband software | Badge printing
 

W: www.eventsoft.nl
E : info@eventsoft.nl


#5 nannoc

nannoc

    Newbie

  • uniGUI Subscriber
  • Pip
  • 9 posts

Posted 28 March 2018 - 02:31 PM

Create a table with you're users and all the menu items or options in you program.
Every menu item or button or option is a field in this table.
This field can be set true/false. After login you do something like :

MainMenu.MenuBank.Enabled := datamodule.table.fieldbyname('Bank').value


Got it, thank you.


Sent from my iPhone using Tapatalk
  • 0

#6 Ruslan

Ruslan

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 58 posts

Posted 29 March 2018 - 01:54 PM

Create a table with you're users and all the menu items or options in you program.
Every menu item or button or option is a field in this table.

This field can be set true/false. After login you do something like :

 

MainMenu.MenuBank.Enabled := datamodule.table.fieldbyname('Bank').value

 

but user can enable this item in source code of the page, after that it will working


  • 1

#7 mierlp

mierlp

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 289 posts
  • LocationWEERT, Netherlands

Posted 30 March 2018 - 02:48 PM

Don't understand what you mean ?

 

I created a separted form which only can access by the administrator for entering

new users or edit access. This 'USERS 'table contains usersname, password, fullname, e-mail etc.

including fields for the properties you want them to have acces to.

 

Let's say you have a table and form called Country. This tables will be used in a other

form as lookup and where the user can select a country. Normally you fill this table Country

once and ready. There's 1 user who has to maintain this tabel Country.

 

You create a field in the USERS table called 'access_country' with the value True or False

I create a form called USERS for add, editing the users and to grant acces (use a checkbox to set

the value for access_country tre or false.

 

that's all


  • 0

Event Management Software | Wristband software | Badge printing
 

W: www.eventsoft.nl
E : info@eventsoft.nl


#8 Ruslan

Ruslan

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 58 posts

Posted 04 April 2018 - 12:28 PM

Don't understand what you mean ?

 

I created a separted form which only can access by the administrator for entering

new users or edit access. This 'USERS 'table contains usersname, password, fullname, e-mail etc.

including fields for the properties you want them to have acces to.

 

Let's say you have a table and form called Country. This tables will be used in a other

form as lookup and where the user can select a country. Normally you fill this table Country

once and ready. There's 1 user who has to maintain this tabel Country.

 

You create a field in the USERS table called 'access_country' with the value True or False

I create a form called USERS for add, editing the users and to grant acces (use a checkbox to set

the value for access_country tre or false.

 

that's all

 

I mean that when you do "MainMenu.MenuBank.Enabled := datamodule.table.fieldbyname('Bank').value" unigui "disable" this item using CSS and user can modify CSS in browser and get access to this menu item. You need additionally check access on server side but not only disable menu


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users