none
Segregation of Duties RRS feed

  • Question

  • Dear Experts

    I have one more issue concerning the super user , I have done the segregation of duties in my application as follows:

    (1) Sales

    (2) Purchases

    (3) Stores

    (4) Finance

    (5) Salaries

    (6) Inventory

    (7) Managers

    by using the code below in collaboration with the user rights table and the login form , it works very well no issues. Now I want to make people with user rights called "Managers" access the entire application, then how can I amend the code below?

    It is on open event

    Dim strSelling As String

    strSelling = " Sales"

    If Forms!FrmLogin!CboUserRights.Column(2) <> [strSeling] Then

    MsgBox " Your not authorized to open this form"

    Cancel = True

    Exit Sub

    End If

    End Sub

    This code is pasted behind the selected forms , and so if login as " Sales " I will be able to access all the areas relating to sales module. Now I want include the users with " Managers " rights as well so that they as well access the sales module, is it possible to amend the above code. Assuming I declare the managers rights as below:

    Dim strAdmin As string

    strAdmin = " Managers" 

    Kindly note all the forms are operated from the switchboard manager

    Regards

    Chris

    Tuesday, May 16, 2017 7:15 AM

All replies

  • Hello Chris,

    >> if login as " Sales " I will be able to access all the areas relating to sales module. Now I want include the users with " Managers " rights as well so that they as well access the sales module

    I think you just need to add an If condition to check if Forms!FrmLogin!CboUserRights.Column(2) equals to strAdmin.

    E.g.

    Dim strSelling As String
    strSelling = " Sales"
    
    Dim strAdmin As string
    strAdmin = " Managers" 
    'if user is manager, no need checking for sales
    If Forms!FrmLogin!CboUserRights.Column(2) =[strAdmin] Then
    MsgBox "Manager could open this form"
    exit sub
    End if
    
    If Forms!FrmLogin!CboUserRights.Column(2) <> [strSeling] Then
    MsgBox " Your not authorized to open this form"
    Cancel = True
    Exit Sub
    End If
    

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 17, 2017 9:24 AM
    Moderator