How can we hide some columns from users

User 1b64124363

03-05-2012 11:28:24

How can we hide some columns from users so that they can't c that ...i mean how to lock custom widget tables from users so that they can't see all columns information. plz reply urgent

ChemAxon 60ee1f1328

03-05-2012 17:02:35

Hi Seerat,


 


I believe there is a "visible" attribute for each field - use it to toggle what is displayed on the form in the table widget.


 


 


DSB

ChemAxon 60ee1f1328

03-05-2012 17:03:34

fields should go grey when not visible

User 0e345a0616

03-05-2012 17:19:53

Thanx for the reply sir


But actually i have created 2 jchem users nd i want to hide some columns from them. so if i will make it invisible like this......they can also make it visible by custom widgets option ...


 


so plz tell me how to hide columns so that dataa will be secure

ChemAxon 60ee1f1328

03-05-2012 18:25:52

Hi,


I should hope you would be able to control this configuration via IJC roles.


http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/security/security_templates.html


Providing you only give your users the "lowest" level roles, then they should not be able to modify the field in your forms.



ROLE_EDIT_DATA: With this role you can edit data in existing tables, add new rows or delete existing rows. You cannot add new fields or tables.


ROLE_USER: You can view all data but cannot make any changes.


Please see page below also but I don't think it should be required for your scenario:



https://www.chemaxon.com/instantjchem/ijc_latest/docs/admin/tips/role_filtering/index.html


Cheers,


 


Daniel.

ChemAxon fa971619eb

03-05-2012 18:40:25

Yes that right, but it applies only to the ability to edit data. If you want to prevent some users from seeing some fields completely then there is no simple way to do this.


There are a couple of things that might be worth looking at, but these are a bit clunky. Of course we hope to provide better alternatives in the future.


1. fields can be hiiden based on roles. This is described here:
http://www.chemaxon.com/instantjchem/ijc_latest/docs/admin/tips/role_filtering/index.html />But although this will hide the fields I think it will need you to create custom forms for each group of users, each form corresponding to a different set of fields.


2. you could create multiple IJC schemas in the same database, each one with a different set of entities and fields (and maybe access control).
But if you had more that a few groups of users then this would become unworkable.


Tim

User 1b64124363

04-05-2012 05:31:24

As per your above suggestion, i have created 2 more roles in ijc_schema table


Role_Chemist  & Role_Biologist


But when i am inserting the values on ijc_schema_autorities table using this query


insert into IJC_SCHEMA_AUTHORITIES (SCHEMA_ID, ITEM_ID, PROPERTY, AUTHORITY) values ("123", "1", 'VISIBILITY', 'ROLE_CHEMIST');


I am getting the follwoing error:-


#1452 - Cannot add or update a child row: a foreign key constraint fails
(`monu`.`ijc_schema_authorities`, CONSTRAINT
`FK_IJC_SCHEMA_AUTHS_SCHEMA` FOREIGN KEY (`SCHEMA_ID`, `ITEM_ID`)
REFERENCES `ijc_schema` (`SCHEMA_ID`, `ITEM_ID`) ON DELETE CASCADE)


 


and one thing more what i have to given the values in ''SCHEMA_ID`, `ITEM_ID`

User 1b64124363

04-05-2012 06:38:05

Now i have created the 3 data trees and 2 role users name Role_chemist and Role_Biologist and two ijc users as mm for Role_Chemist and bio for Role_Biologist , and i  did all the steps...but when i get login with user mm and bio


i am getting the error


Access is denied and Bad credentials


 


plz reply

ChemAxon 60ee1f1328

04-05-2012 08:48:15

Hi Seerat,


 


Please check the HTML example again - we think you need to create any new roles in IJC_AUTHORITIES table please rather than IJC_SCHEMA. So you may need to roll back and roll forward again...


 


Cheers,


 


Daniel.

User 1b64124363

04-05-2012 11:20:40

sorry i had not created the roles in ijc_schema that was written by mistake....i make it on ijc_authorities....after that i am getting the same error

ChemAxon 60ee1f1328

04-05-2012 11:43:47

Hi Seerat,


 


Can you please tell us which RDBMS type you are using - we will now need to try and replicate your observation.


 


Thanks,


Daniel.

User 1b64124363

04-05-2012 12:20:50

Hi


I am using MYSQl database

ChemAxon 60ee1f1328

04-05-2012 13:29:50

Thank you we will look into replicating your issue on mysql...please bear with us...

ChemAxon 60ee1f1328

08-05-2012 08:49:03

OK - I tried the basic example again in MYSQL and it worked as per the instructions in the HTML.


I have two users which each have there own exclusive datatree and share one.


One thing, since you are adding this additional data directly in mysql you might want to make sure your connected to the correct database (same as IJC app). If you get any further error please post it...as I say the basic example works fine for me, I guess you should see that working before we attempt to filter fields...

User 1b64124363

08-05-2012 11:24:45

Thanx for your reply


Sir, i have follow the steps , but i am not getting how come to hide columns from users..like


suppose we have 3 tables n having fields    structure, id , molwt, formula


and i want to show only structure and id to chemist and molwt, formula to biologist only ....then how to hide from this way.

User 1b64124363

08-05-2012 11:44:32

How to hide a field from users

ChemAxon 60ee1f1328

08-05-2012 12:28:56

Please confirm the example works at the data tree level first as described in the HTML.


(Previously you mentioned an error message - do you see the same error if you just stick to the example?)


Then I will try the fields level...

User 1b64124363

09-05-2012 04:13:53

Yep sir at tree level it is working f9 according to HTML instructions....but how to hide columns from that tree

ChemAxon 60ee1f1328

09-05-2012 09:50:32

Hello Seerat,


I got round to trying it out at the field level and it worked fine for me.


I simply applied the same logic in the HTML at the field level.


For the datatree that is already set up as shared and accessible by both ROLE_CHEMIST & ROLE_BIOLOGIST add three new fields of type TEXT.


1. shared


2. chemist_only


3. biologist_only.


Next run the SQL to obtain the correct ID values, to configure your inserts.


select SCHEMA_ID, ITEM_ID, ITEM_VALUE from IJC_SCHEMA where GENERIC_TYPE = 'FIELD';

 


Then run the relevant inserts, for example (use your ID's these are dummy):


--exclusive to chemist

insert into IJC_SCHEMA_AUTHORITIES (SCHEMA_ID, ITEM_ID, PROPERTY, AUTHORITY) values 

('76BD69862EF1FBA6EE8431F0AD40B33C', 'A0B80EA4FFDCAFECED1F2674005E7B28', 'VISIBILITY', 'ROLE_CHEMIST'); 

--exclusive to biologist

insert into IJC_SCHEMA_AUTHORITIES (SCHEMA_ID, ITEM_ID, PROPERTY, AUTHORITY) values 

('76BD69862EF1FBA6EE8431F0AD40B33C', '58A4D1931C602127F62DFD556CFAC04C', 'VISIBILITY', 'ROLE_BIOLOGIST'); 

--shared by both, hence two entry for the same field.

insert into IJC_SCHEMA_AUTHORITIES (SCHEMA_ID, ITEM_ID, PROPERTY, AUTHORITY) values 

('76BD69862EF1FBA6EE8431F0AD40B33C', '9C87D32CC05371D5023F84E6C3B340D4', 'VISIBILITY', 'ROLE_CHEMIST'); 

insert into IJC_SCHEMA_AUTHORITIES (SCHEMA_ID, ITEM_ID, PROPERTY, AUTHORITY) values 

('76BD69862EF1FBA6EE8431F0AD40B33C', '9C87D32CC05371D5023F84E6C3B340D4', 'VISIBILITY', 'ROLE_BIOLOGIST); 

 


 


Login as user with ROLE_CHEMIST role and only two field appear in shared data tree : chemist_only,shared


 


Login as user with ROLE_BIOLOGIST role and only two field appear in shared data tree : biologist_only, shared


 


Note, you can only see them when you set up a form and attempt to bind fields, since you don't have ROLE_EDIT_SCHEMA applied for either user you cannot see them under the data tree in the project explorer or can you "edit schema" without that role - if you apply the role you see all !


Conclusion : It works perfectly !


 

User 1b64124363

09-05-2012 12:09:27

Hello Sir


i have also gone through the same steps...but still unable to hide fields....plz look at the file attached.


 



ChemAxon 60ee1f1328

09-05-2012 14:12:34

Hi Seerat,


 


So you have included some core fields and some non-core fields in your example.


Please allow me to try it out...presumably you want to hide the core fields?


 


Daniel.


 


 

ChemAxon 60ee1f1328

11-05-2012 14:13:09

If you wish to hide fields for CHEMIST or BIOLOGIST you have to do some little trick.


 


You need to place an insert for the field you wish to hide and associate it with the ROLE_ADMIN role.


You need to do this for all fields you might wish to hide.


If you then want to unhide them for another particular non- admin role, you then need to add another insert for that specific role - this might only arise in a shared data tree scenario I think ?


 


I tried it and it works but does it make sense ?