Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can wildcard '*' be used in section access ton restrict data?

hi,

I have a table with product field. I want to use section access to restrict data.

For example, when user ADMIN logon, the user can access PROCUDT 1,11,12,13. Can I use wildcard * here? like 1*

Thanks for your help.

Section Access;
LOAD * INLINE [
ACCESS, USERID
ADMIN, ADMIN
];
Section Application;
STAR IS *;
LOAD * INLINE [
USERID, PRODUCT
ADMIN, 1*
];

LOAD * INLINE [
PRODUCT
1
11
12
13
2
21
22
23
];


5 Replies
Not applicable
Author

I use this code. Can it be simpler?

Section Access;
LOAD * INLINE [
ACCESS, USERID
ADMIN, ADMIN
];
Section Application;
STAR IS *;
LOAD * INLINE [
USERID, HA
ADMIN, 1
];

tab:
LOAD * INLINE [
PRODUCT
1
11
12
13
2
21
22
23
];
tab1:
load
PRODUCT,
LEFT(PRODUCT,1) AS HA
RESIDENT tab;
DROP TABLE tab;


Miguel_Angel_Baeyens

Hello,

It's not possible to use wildcards in section access. So you will have to add as many lines as possible values you want the user to see (or group them some way).

I'd use your code something like

Section Access; // All possible values starting in "1"LOAD * INLINE [ ACCESS, USERID, PRODUCT ADMIN, ADMIN, 1 ADMIN, ADMIN, 11 ADMIN, ADMIN, 12 ADMIN, ADMIN, 13]; Section Application; //STAR IS *; // This line is not needed here LOAD * INLINE [ PRODUCT 1 11 12 13 2 21 22 23];


Hope that helps.

Not applicable
Author

hi, thank you for your reply.

But in my product evirerment, the number will be XXX*****. I think it is not possible to insert 99999 rows in section access table. So may be there have some simpler way? Big Smile

Miguel_Angel_Baeyens

Hello,

Unfortunately, there's not. You can either set all the possible values in section access or in any other table related to a group, out of the section access. Say that in section access you associate each user to a group (Sales, HR, Marketing) and this group is the reduction field.

Then, you assign to each group the numbers corresponding to them (say 1* for Sales, 2* for HR, 3* for marketing and so on). But in both cases all values must be listed.

Hope that helps.

Not applicable
Author

hi Miguel

Thank you very much:) From your post I know what can QV do.

I think may be I can add a more field like what my second post write to solve the problem:)