JS security question

Questions, tips and tricks and techniques for scripting in Servoy

JS security question

Postby Harjo » Thu Jan 13, 2011 6:26 pm

HI

for a table: orders I don't want the user to be able to delete.


this is the example, servoy gives me:
Code: Select all
row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security


do I need to set a ! in front the JSSecurity.DELETE?

so this:?
Code: Select all
row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|!JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: JS security question

Postby patrick » Thu Jan 13, 2011 7:12 pm

I think you should just omit the DELETE constant...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: JS security question

Postby Harjo » Thu Jan 13, 2011 10:14 pm

I don't understand.

if I just run the sample:

Code: Select all
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method


I get this error:
Code: Select all
ReferenceError: "JSSecurity" is not defined.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: JS security question

Postby patrick » Thu Jan 13, 2011 10:38 pm

That is a known problem. Use security instead of JSSecurity. See this viewtopic.php?f=8&t=15346&p=82365
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: JS security question

Postby Harjo » Thu Jan 13, 2011 10:42 pm

ah thanks Patrick, just found the topic myself!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests

cron