Appling Security Filters on Permissions

S0918423470S0918423470 Member Posts: 159
Hello All,

I set roles for users, i read document about the security, i found the section Appling Security Filters on Permissions table. I want user only to be able to choose their batch name when they use general journal.

With Role G/L-JOURNAL, POST\Permission : Table data 232 - Gen. Journal Batch on the Security filters , i setup this value : Gen. Journal Batch: Journal Template Name=GENERAL,Name=TESTA
But when i login by user who use Role G/L-JOURNAL, POST, it is the same. I can choose all batches.
When i setup value for Security Filters, i saw they open Table Filter form to type data but it not works like table filter.

I use Navision SQL option Version 5.0, SQL server 2000.

I tried to to this with table 18 , it's ok. Exp : i set security filters for T18 only No = Cust A.
But when i do that for GL Account, it doesn't work.
This function (Secutiry Filters) is so difficult to use. ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)

I read documents they said that : Security filters can only be applied to tables and the records that they contain.
But when i use it, some table it's ok, but others it's not.

anyone ever use Security Filters, could you tell me about this?? I'm so confused about that.

Thanks,
HN

Answers

  • kinekine Member Posts: 12,562
    If the form is opened by button without C/AL code, Security fitlers will be applied automatically. If the form is opened by C/AL code (e.g. Journal Batch selection), you need to change the code and use the command "SETPERMISSIONFILTER" on the record, which is passed to the form.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hi Kine,

    I tried to do like your way, but it does not work.
    I modified codeunit 230 , function LookupName(VAR CurrentJnlBatchName : Code[10];VAR GenJnlLine : Record "Gen. Journal Line")
    COMMIT;
    GenJnlBatch."Journal Template Name" := GenJnlLine.GETRANGEMAX("Journal Template Name");
    GenJnlBatch.Name := GenJnlLine.GETRANGEMAX("Journal Batch Name");
    GenJnlBatch.FILTERGROUP := 2;
    GenJnlBatch.SETRANGE("Journal Template Name",GenJnlBatch."Journal Template Name");
    GenJnlBatch.FILTERGROUP := 0;

    //HN
    GenJnlBatch.SETPERMISSIONFILTER;//This is my code

    IF FORM.RUNMODAL(0,GenJnlBatch) = ACTION::LookupOK THEN BEGIN
    CurrentJnlBatchName := GenJnlBatch.Name;
    SetName(CurrentJnlBatchName,GenJnlLine);
    END;

    Is it right?? Or i must re-write codes to get filters values from Sercurity Filters on Permission and set filter to Gen. Jnl batch table by above filters??
    Thanks.
  • kinekine Member Posts: 12,562
    Are you sure, that the user has no another permission line allowing him to see all entries in the table? Check that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hi Kine,

    It works, thanh you so much. I lost security filters for T232 in another roles.

    Thanks, :lol::lol::lol::lol:
    HN
  • kinekine Member Posts: 12,562
    You are welcome... :-)

    Most problems have simple reason...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hello Kine,

    I have another problem ](*,) ](*,)

    When i use Speruser to setup permission for test user, i opened Gen. Jnl , Cash, Payments with some batches.

    When i log in by test user - this user is set up by Specific sercutity filters for batche name - i have message "You have not permission to read Gen. Batches Name".

    I logout and login by Super user, i opened these forms by specific batch name which are setup on Security Filters. after that i re-login again with test user, i can open these forms.

    Exp:
    Superuser : i opened Gen. Jnl with batch name A
    Testuser : i set Security Filters with specific batch name : B

    I login by Testuser ,i open Gen. Jnl form , i have pb. ](*,) ](*,) ](*,)

    I know it caused by CurrentJnlBatchName, it's always remembers the last batches.
    How can we refresh this??
  • kinekine Member Posts: 12,562
    try to disable "Save Values" on the form. It will not save the values into ZUP file...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hello kine,

    Thanh you so much. It works well.



    =D> =D> :D:D
Sign In or Register to comment.