Page 1 of 1

Prevent specific groups from directly accessing a table

Posted: 2021-01-20 18:51
by ayussuf
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.

Re: Prevent specific groups from directly accessing a table

Posted: 2021-01-20 19:21
by landinialejandro
hello, you have a mistake in the word function, the word is misspelled.

Re: Prevent specific groups from directly accessing a table

Posted: 2021-01-21 00:49
by ayussuf
: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?

Re: Prevent specific groups from directly accessing a table

Posted: 2021-01-21 01:51
by landinialejandro
You write funtion

Re: Prevent specific groups from directly accessing a table

Posted: 2021-01-21 02:04
by ayussuf
landinialejandro wrote:
2021-01-21 01:51
You write funtion
Thank you very much