Professional Web Applications Themes

Filtering - Microsoft SQL / MS SQL Server

Lets say I have a privilege structure organized by number: 1 - Administrator 2 - Office 3 - Supervisor 4 - Field Operator 5 - Assistant Operator Levels 1, 2, and 3 have the ability to add new employees to the system. However, when adding these new employees, I don't want them to have the ability to add a user with a higher level than their own. For example, if an office person with a user level of 2 adds an employee, I don't want them to be able to see the '1' in the list. If a supervisor adds ...

  1. #1

    Default Filtering

    Lets say I have a privilege structure organized by number:

    1 - Administrator
    2 - Office
    3 - Supervisor
    4 - Field Operator
    5 - Assistant Operator

    Levels 1, 2, and 3 have the ability to add new employees to the system.
    However, when adding these new employees, I don't want them to have the
    ability to add a user with a higher level than their own. For example, if
    an office person with a user level of 2 adds an employee, I don't want them
    to be able to see the '1' in the list. If a supervisor adds an employee, I
    don't want them to be able to see '1' or '2' in the dropdown list. Is there
    an easy way to accomplish this type of 'filtering'?

    Any help is greatly appreciated.

    Best Regards,
    Brad


    Brad M. Guest

  2. #2

    Default Re: Filtering

    Brad,

    You could use CURRENT_USER to look up a table that has their
    level, returning ( from another table ?) job titles of lower rank. Use
    this for populating the list/box.

    Regards
    AJ

    "Brad M." <officespaceatshawdotca> wrote in message news:%238jafpASDHA.1688TK2MSFTNGP11.phx.gbl...
    > Lets say I have a privilege structure organized by number:
    >
    > 1 - Administrator
    > 2 - Office
    > 3 - Supervisor
    > 4 - Field Operator
    > 5 - Assistant Operator
    >
    > Levels 1, 2, and 3 have the ability to add new employees to the system.
    > However, when adding these new employees, I don't want them to have the
    > ability to add a user with a higher level than their own. For example, if
    > an office person with a user level of 2 adds an employee, I don't want them
    > to be able to see the '1' in the list. If a supervisor adds an employee, I
    > don't want them to be able to see '1' or '2' in the dropdown list. Is there
    > an easy way to accomplish this type of 'filtering'?
    >
    > Any help is greatly appreciated.
    >
    > Best Regards,
    > Brad
    >
    >

    Andrew John Guest

  3. #3

    Default Re: Filtering

    If the ranking is based on the ID level of each row then you can write a
    query as mentioned in following example.
    Ex:
    create table #rank(idd int, post varchar(500))
    insert into #rank values(1 , 'Administrator')
    insert into #rank values(2 , 'Office')
    insert into #rank values(3 , 'Supervisor')
    insert into #rank values(4 , 'Field Operator')
    insert into #rank values(5 , 'Assistant Operator')

    declare current_user_id int
    select current_user_id = 2
    select post from #rank
    where IDD > current_user_id

    --
    -Vishal
    "Brad M." <officespaceatshawdotca> wrote in message
    news:#8jafpASDHA.1688TK2MSFTNGP11.phx.gbl...
    > Lets say I have a privilege structure organized by number:
    >
    > 1 - Administrator
    > 2 - Office
    > 3 - Supervisor
    > 4 - Field Operator
    > 5 - Assistant Operator
    >
    > Levels 1, 2, and 3 have the ability to add new employees to the system.
    > However, when adding these new employees, I don't want them to have the
    > ability to add a user with a higher level than their own. For example, if
    > an office person with a user level of 2 adds an employee, I don't want
    them
    > to be able to see the '1' in the list. If a supervisor adds an employee,
    I
    > don't want them to be able to see '1' or '2' in the dropdown list. Is
    there
    > an easy way to accomplish this type of 'filtering'?
    >
    > Any help is greatly appreciated.
    >
    > Best Regards,
    > Brad
    >
    >

    Vishal Parkar Guest

Similar Threads

  1. Filtering a tree
    By CN_Dafolo in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: June 5th, 04:22 AM
  2. Filtering by more than one column?
    By I Need Help! in forum Dreamweaver AppDev
    Replies: 1
    Last Post: March 23rd, 08:57 AM
  3. Row filtering
    By siaj in forum ASP.NET Web Services
    Replies: 0
    Last Post: February 24th, 06:33 PM
  4. filtering in datagrid
    By rk in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 6th, 05:46 PM
  5. More on Filtering forms
    By Maz Ten in forum Microsoft Access
    Replies: 1
    Last Post: July 11th, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139