Added some permission checks

This commit is contained in:
Sasha Koshka 2022-10-13 02:20:47 -04:00
parent ae50fab159
commit b8693af68b
4 changed files with 53 additions and 3 deletions

View File

@ -249,6 +249,19 @@ func (analyzer *analysisOperation) typeCheck (
return return
} }
// inCurrentModule returns whether or not the specified section resides within
// the current module.
func (analyzer *analysisOperation) inCurrentModule (
section Section,
) (
inCurrent bool,
){
inCurrent =
section.locator().modulePath ==
analyzer.currentPosition.modulePath
return
}
// doIndent perfroms a fmt.Sprint operation on input, indenting the string. This // doIndent perfroms a fmt.Sprint operation on input, indenting the string. This
// does not add a trailing newline. // does not add a trailing newline.
func doIndent (indent int, input ...any) (output string) { func doIndent (indent int, input ...any) (output string) {

View File

@ -169,6 +169,8 @@ func (analyzer *analysisOperation) analyzeObjectMembers (
err error, err error,
) { ) {
inheritedSection := into.what.actual inheritedSection := into.what.actual
inheritsFromSameModule := analyzer.inCurrentModule(inheritedSection)
for index := 0; index < from.MembersLength(); index ++ { for index := 0; index < from.MembersLength(); index ++ {
inputMember := from.Member(index) inputMember := from.Member(index)