| Module | MUES::SafeCheckFunctions |
| In: |
lib/mues/mixins.rb
(CVS)
|
Mixin module that adds some $SAFE-level checking functions to the current scope.
Check the current $SAFE level, and if it is greater than permittedLevel, raise a SecurityError.
# File lib/mues/mixins.rb, line 352 def checkSafeLevel( permittedLevel=2 ) raise SecurityError, "Call to restricted method from insecure space ($SAFE = #{$SAFE})", caller(1) if $SAFE > permittedLevel return true end
Check the current $SAFE level and the taintedness of the current self, raising a SecurityError if $SAFE is greater than permittedLevel, or self is tainted.
# File lib/mues/mixins.rb, line 362 def checkTaintAndSafe( permittedLevel=2 ) raise SecurityError, "Call to restricted code from insecure space ($SAFE = #{$SAFE})", caller(1) if $SAFE > permittedLevel raise SecurityError, "Call to restricted code with tainted receiver", caller(1) if self.tainted? return true end