Prevent specific groups from directly accessing a table

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
ayussuf
Veteran Member
Posts: 39
Joined: 2021-01-20 17:15

Prevent specific groups from directly accessing a table

Post by ayussuf » 2021-01-20 18:51

Hello,

I've tried this code to hide some tables from being accessed by some groups.

Code: Select all

    $mi = getMemberInfo();
    // hide the table only if the user belongs to this group
    if($mi['group'] == 'Pelajar') {
        ?>
        <script>
			console.log('Pelajar group detected');
			$j(funtion() {
				$j('#Penyelia-tile, #Pembimbing-tile, #Seliaan-tile').remove();	
				$j('.nav a[href^=Penyelia_view], .nav a[href^=Pembimbing_view], .nav a[href^=Seliaan_view]').remove();	
			})
		</script>
        <?php
    }
Source: https://bigprof.com/blog/appgini/preven ... n-appgini/

Unfortunately, the tables still displayed and I got this error on console:

Uncaught SyntaxError: missing ) after argument list

What is the problem actually?

Thanks.
AppGini 5.92 - Upgraded to 5.94

User avatar
landinialejandro
AppGini Super Hero
AppGini Super Hero
Posts: 126
Joined: 2016-03-06 00:59
Location: Argentina
Contact:

Re: Prevent specific groups from directly accessing a table

Post by landinialejandro » 2021-01-20 19:21

hello, you have a mistake in the word function, the word is misspelled.
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.

Some of my posts that may interest you:
:arrow: Landini Admin Template: Template for Appgini like AdminLTE
:arrow: Profile image plugin: add and changue image user profile
:arrow: Field editor in table view: Configurable fast edit fields in TV
:idea: my personal page

ayussuf
Veteran Member
Posts: 39
Joined: 2021-01-20 17:15

Re: Prevent specific groups from directly accessing a table

Post by ayussuf » 2021-01-21 00:49

:P
landinialejandro wrote:
2021-01-20 19:21
hello, you have a mistake in the word function, the word is misspelled.
May I know which part is misspelled?
AppGini 5.92 - Upgraded to 5.94

User avatar
landinialejandro
AppGini Super Hero
AppGini Super Hero
Posts: 126
Joined: 2016-03-06 00:59
Location: Argentina
Contact:

Re: Prevent specific groups from directly accessing a table

Post by landinialejandro » 2021-01-21 01:51

You write funtion
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.

Some of my posts that may interest you:
:arrow: Landini Admin Template: Template for Appgini like AdminLTE
:arrow: Profile image plugin: add and changue image user profile
:arrow: Field editor in table view: Configurable fast edit fields in TV
:idea: my personal page

ayussuf
Veteran Member
Posts: 39
Joined: 2021-01-20 17:15

Re: Prevent specific groups from directly accessing a table

Post by ayussuf » 2021-01-21 02:04

landinialejandro wrote:
2021-01-21 01:51
You write funtion
Thank you very much
AppGini 5.92 - Upgraded to 5.94

Post Reply