Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am trying to provide section access o the below scenario:
I have a table like this. So i am providing access on NTNAME, I want when a Student login's, he should see only his data and when a teacher access he can see his as well as all his students marks.
Student | Teacher | Marks |
A | ABC | 21 |
B | ABC | 24 |
C | ABC | 12 |
D | DEF | 21 |
E | DEF | 32 |
F | DEF | 33 |
Thanks and Regards
KC
You need to section on both student and teacher.
You'll have one row for each student user
Section Access;
LOAD * INLINE [
ACCESS, USERID, STUDENT, TEACHER
ADMIN, admin, ,
USER, a, A, ABC
USER, b, B, ABC
USER, c, C, ABC
USER, d, D, DEF
USER, e, E, DEF
USER, f, F, DEF
USER, ABC, A, ABC
USER, ABC, B, ABC
USER, ABC, C, ABC
USER, DEF, A, ABC
USER, DEF, B, ABC
USER, DEF, C, ABC
];
Section Application;
load * inline [
STUDENT,TEACHER,Marks
A,ABC,21
B,ABC,24
C,ABC,12
D,DEF,21
E,DEF,32
F,DEF,33
];
Hi,
Can you explain your data more because I see same Marks data is available for teacher as well as student there is no such difference.
Thanks,
Hi Vijeta,
Over here marks are associated to Students. i am sorry i missed to updated that.
So when Student A opens the app, he should see only his data and when teacher ABC logins he should see marks of A,B,C.
Hope now i am able to clear it.
Regards
KC
follow this,
Row Level Access
Section
Access;
Load *
Inline
[ACCESS,USERID,PASSWORD,REGION
ADMIN,A,X,
USER,U1,Y1,AFRICA
USER,U2,Y2,AMERICA
USER,U3,Y3,ASIA
USER,U4,Y4,EUROPE
USER,U5,Y5,*];
Section
Application;
SALES:
LOAD *
INLINE
[
REGION, PROFIT
AFRICA, 1000
AMERICA, 2000
ASIA, 3000
EUROPE, 4000
OCEANIA, 5000
];
You need to section on both student and teacher.
You'll have one row for each student user
Section Access;
LOAD * INLINE [
ACCESS, USERID, STUDENT, TEACHER
ADMIN, admin, ,
USER, a, A, ABC
USER, b, B, ABC
USER, c, C, ABC
USER, d, D, DEF
USER, e, E, DEF
USER, f, F, DEF
USER, ABC, A, ABC
USER, ABC, B, ABC
USER, ABC, C, ABC
USER, DEF, A, ABC
USER, DEF, B, ABC
USER, DEF, C, ABC
];
Section Application;
load * inline [
STUDENT,TEACHER,Marks
A,ABC,21
B,ABC,24
C,ABC,12
D,DEF,21
E,DEF,32
F,DEF,33
];
How about this?
Section Access;
// This should really load all ID's from some external source
LOAD * INLINE [
ACCESS, NTNAME, LINK
ADMIN, QVSERVICE,
ADMIN, YOU, *
USER, A, A
USER, B, B
USER, C, C
USER, D, D
USER, E, E
USER, F, F
USER, ABC, ABC
USER, DEF, DEF
];
Section Application;
// First load all your data, including the table you posted
// as an example. Call that table 'Marks'. It has to contain
// at least two fields: Student, and Teacher.
LinkTable:
NOCONCATENATE
LOAD upper(Student) AS LINK, Student
RESIDENT Marks;
CONCATENATE (linkTable)
LOAD Upper(Teacher) AS LINK, Student
RESIDENT Marks;
// Done
Thanks a lot Jonathan
Thanks a lot peter, both worked