473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I limit access to objects in Python?

Hi,

I have an application that embeds the Python interpreter. My users have
access to the interpreter through a console like window and they can run
Python scripts. For my application I use some Python modules (say module
Restricted) that I don't want to give my users access to. However, the
modules that I make public to my users and that I want my users to be
able to use themselves use the Restricted module. Any suggestions on how
to solve this? I was thinking of instantiating a separate interpreter
but I don't think this will solve my problem.

Thanks,
Thomas

Jun 27 '06 #1
1 1240
Tommytrojan schrieb:
Hi,

I have an application that embeds the Python interpreter. My users have
access to the interpreter through a console like window and they can run
Python scripts. For my application I use some Python modules (say module
Restricted) that I don't want to give my users access to. However, the
modules that I make public to my users and that I want my users to be
able to use themselves use the Restricted module. Any suggestions on how
to solve this? I was thinking of instantiating a separate interpreter
but I don't think this will solve my problem.


I don't think that is possible - how is one to distinguish your code
from the code written by a user that calls one method in the restricted
module?

What you _can_ do is to spawn an interpreter, and expose the allowed
objects via Pyro.
The question is though: why cripple your users? If someone could reach
an otherwise unreachable goal why do yoou hinder him? What is the
reasoning behind that?

Diez
Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christian Tismer | last post by:
Martin v. Löwis wrote: > "Mark Hahn" <mark@hahnca.com> writes: > > >>I don't understand how this could happen with pickle. Isn't it supposed to >>stop when it runs into an object it has...
25
by: chad | last post by:
I am writing a program to do some reliability calculations that require several nested for-loops. However, I believe that as the models become more complex, the number of required for-loops will...
1
by: K Gibbs | last post by:
Lets say I have two threads which "communicate" via a shared object (passed to them as a reference when they are created). The shared object is primarily composed of getters and setters. In quite...
1
by: Andy Leszczynski | last post by:
I need to pickle quite complex objects and first limitation was default 200 for the recursion. sys.setrecursionlimit helped, but still bigger objects fail to be pickled because of XP stack size...
3
by: Colleyville Alan | last post by:
From the MS Access help I have seen the limits on number of fields in an index, objects in a db, etc. But I have seen no mention on a limit of rows. I am considering an application that would have...
3
by: ken | last post by:
Hi, I was wondering how the 4k table record limit is counted. I have access 2k. I text fields are 256 chars. Memo fields are not included in the calculation. What about yes/no fields would that be...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
10
by: elventear | last post by:
Hello everyone, I am runing into recursion limit problems. I have found that the culprit was related to the __hash__ function that I had assigned to the objects that were added to a set. ...
3
by: Mathieu Prevot | last post by:
Hi, I have a multithreaded script that mainly creates several wget processes to download files. I would like to check/see and eventually limit the bandwidth of the pool of processes. One way to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.